;
(self.AMP=self.AMP||[]).push({m:1,v:"2405022220000",n:"amp-analytics",ev:"0.1",l:!0,f:function(t,i){(()=>{var i;function s(){return i||(i=Promise.resolve(void 0))}var e=class{constructor(){this.promise=new Promise(((t,i)=>{this.resolve=t,this.reject=i}))}},{isArray:n}=Array;function r(t,i){for(let s=0;s<t.length;s++)if(i(t[s],s,t))return s;return-1}function o(t,i){const s=t.length-i.length;return s>=0&&t.indexOf(i,s)==s}function h(t,i,s){const e=s||1;for(let s=0;s<e;s++){let s=0;if(t=t.replace(/\${([^{}]*)}/g,((t,e)=>(s++,i(e)))),!s)break}return t}var{hasOwnProperty:u,toString:c}=Object.prototype;function a(t){return"[object Object]"===c.call(t)}function l(t){const i=Object.create(null);return t&&Object.assign(i,t),i}function f(t,i){return u.call(t,i)}function d(t,i,s=10){const e=[],n=[];for(n.push({t:t,s:i,d:0});n.length>0;){const{d:t,s:i,t:r}=n.shift();if(e.includes(i))throw new Error("Source object has a circular reference.");if(e.push(i),r!==i)if(t>s)Object.assign(r,i);else for(const s of Object.keys(i)){const e=i[s];if(f(r,s)){const i=r[s];if(a(e)&&a(i)){n.push({t:i,s:e,d:t+1});continue}}r[s]=e}}return t}function _(t){return"number"==typeof t&&isFinite(t)}function m(t,i,s,e,n,r,o,h,u,c,a){return t}function A(t){return JSON.parse(t)}function P(t,i){try{return A(t)}catch(t){return null==i||i(t),null}}function p(t){return(t.ownerDocument||t).defaultView}function T(t,i){return t.replace(/^|,/g,`$&${i} `)}function E(t,i){return t.closest(i)}function g(t,i,s){return function(t,i){for(const s in i)t.setAttribute(s,i[s]);return t}(t.createElement(i),s)}function I(t,i,s){const e=i||(t=>t),{dataset:n}=t,r={},o=s||/^param(.+)/;for(const t in n){const i=t.match(o);i&&(r[e(i[1][0].toLowerCase()+i[1].substr(1))]=n[t])}return r}function v(t){return t.parent&&t.parent!=t}function R(t){const i=Object.getOwnPropertyDescriptor(t,"message");if(null!=i&&i.writable)return t;const{message:s,stack:e}=t,n=new Error(s);for(const i in t)n[i]=t[i];return n.stack=e,n}function M(t){let i=null,s="";for(const t of arguments)t instanceof Error&&!i?i=R(t):(s&&(s+=" "),s+=t);return i?s&&(i.message=s+": "+i.message):i=new Error(s),i}function b(t){var i,s;null===(i=(s=self).__AMP_REPORT_ERROR)||void 0===i||i.call(s,t)}function S(t){const i=M.apply(null,arguments);setTimeout((()=>{throw b(i),i}))}var y=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g;function w(t,i=""){try{return decodeURIComponent(t)}catch(t){return i}}function O(t){const i=l();if(!t)return i;let s;for(;s=y.exec(t);){const t=w(s[1],s[1]),e=s[2]?w(s[2].replace(/\+/g," "),s[2]):"";i[t]=e}return i}function V(t){const{location:i}=t||self;return O(i.originalHash||i.hash)}var N="";function C(t){const i=t||self;return i.__AMP_MODE?i.__AMP_MODE:i.__AMP_MODE=function(t){return{localDev:!1,development:L(t,V(t)),esm:!0,test:!1,rtvVersion:k(t),ssrReady:!1}}(i)}function k(t){var i;return N||(N=(null===(i=t.AMP_CONFIG)||void 0===i?void 0:i.v)||"012405022220000"),N}function L(t,i){const s=i||V(t);return["1","actions","amp","amp4ads","amp4email"].includes(s.development)||!!t.AMP_DEV_MODE}var D=(()=>self.AMP.config.urls)();self.__AMP_LOG=self.__AMP_LOG||{user:null,dev:null,userForEmbed:null};var x=self.__AMP_LOG;function U(t,i){throw new Error("failed to call initLogConstructor")}function H(t){return x.user||(x.user=j()),function(t,i){return i&&i.ownerDocument.defaultView!=t}(x.user.win,t)?x.userForEmbed||(x.userForEmbed=j()):x.user}function j(t){return U()}function F(){return x.dev||(x.dev=U())}function q(t,i,s,e,n,r,o,h,u,c,a){return t}function $(t,i,s,e,n,r,o,h,u,c,a){return H().assert(t,i,s,e,n,r,o,h,u,c,a)}function B(t,i){return Q(t=K(t),i)}function G(t,i){return Q(Z(J(t)),i)}function W(t,i){const s=Z(J(t));return et(s,i)?Q(s,i):null}function z(t,i){return function(t,i){const s=it(t,i);if(s)return s;const n=st(t);return n[i]=function(){const t=new e,{promise:i,reject:s,resolve:n}=t;return i.catch((()=>{})),{obj:null,promise:i,resolve:n,reject:s,context:null,ctor:null}}(),n[i].promise}(Z(t),i)}function Y(t,i){return it(Z(t),i)}function K(t){return t.__AMP_TOP||(t.__AMP_TOP=t)}function X(t,i){const s=(t.ownerDocument||t).defaultView,e=i||K(s);if(s&&s!=e&&K(s)==e)try{return s.frameElement}catch(t){}return null}function J(t){return t.nodeType?(i=p(t),B(i,"ampdoc")).getAmpDoc(t):t;var i}function Z(t){const i=J(t);return i.isSingleDoc()?i.win:i}function Q(t,i){q(et(t,i));const s=st(t)[i];return s.obj||(q(s.ctor),q(s.context),s.obj=new s.ctor(s.context),q(s.obj),s.context=null,s.resolve&&s.resolve(s.obj)),s.obj}function tt(t,i,s,e,n,r){const o=st(t);let h=o[s];h||(h=o[s]={obj:null,promise:null,resolve:null,reject:null,context:null,ctor:null,sharedInstance:r||!1}),!n&&h.ctor||(h.ctor=e,h.context=i,h.sharedInstance=r||!1,h.resolve&&Q(t,s))}function it(t,i){const s=st(t)[i];return s?s.promise?s.promise:(Q(t,i),s.promise=Promise.resolve(s.obj)):null}function st(t){let i=t.__AMP_SERVICES;return i||(i=t.__AMP_SERVICES={}),i}function et(t,i){const s=t.__AMP_SERVICES&&t.__AMP_SERVICES[i];return!(!s||!s.ctor)}function nt(t,i,s,e){const n=Y(t,i);if(n)return n;const r=J(t);return r.whenExtensionsKnown().then((()=>{const t=r.getExtensionVersion(s);return t?B(r.win,"extensions").waitForExtension(s,t):null})).then((s=>s?e?Y(t,i):z(t,i):null))}var rt,ot=t=>J(t),ht=t=>B(t,"crypto"),ut=t=>B(t,"performance"),ct=t=>B(t,"preconnect"),at=t=>Q(t,"timer"),lt=t=>W(t,"url-replace"),ft=t=>nt(t,"consentPolicyManager","amp-consent"),dt=t=>W(t,"url"),_t=t=>G(t,"viewport"),mt=t=>B(t,"xhr");function At(t,i,s,e){let n=t,r=s,o=t=>{try{return r(t)}catch(t){var i,s;throw null===(i=(s=self).__AMP_REPORT_ERROR)||void 0===i||i.call(s,t),t}};const h=function(){if(void 0!==rt)return rt;rt=!1;try{const t={get capture(){return rt=!0,!1}};self.addEventListener("test-options",null,t),self.removeEventListener("test-options",null,t)}catch(t){}return rt}(),u=!(null==e||!e.capture);return n.addEventListener(i,o,h?e:u),()=>{null==n||n.removeEventListener(i,o,h?e:u),r=null,n=null,o=null}}function Pt(t,i,s,e){return At(t,i,s,e)}function pt(t){return t.data}function Tt(t,i,s,e){let n=s;const r=At(t,i,(t=>{try{n(t)}finally{n=null,r()}}),e);return r}function Et(t){return"AUDIO"===t.tagName||"VIDEO"===t.tagName}var gt="active";function It(t,i){let s=0;return t.type===gt&&(s=5),Math.min(i-t.time,s)}var vt=["mousedown","mouseup","mousemove","keydown","keyup"],Rt=["mouseleave"];function Mt(t,i,s){return i in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}function bt(t,i){var s=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);i&&(e=e.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),s.push.apply(s,e)}return s}function St(t){for(var i=1;i<arguments.length;i++){var s=null!=arguments[i]?arguments[i]:{};i%2?bt(Object(s),!0).forEach((function(i){Mt(t,i,s[i])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):bt(Object(s)).forEach((function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(s,i))}))}return t}var yt="__AMP__EXPERIMENT_TOGGLES",wt=JSON.parse('{"transport":{"beacon":true,"xhrpost":true,"image":true},"vars":{"accessReaderId":"ACCESS_READER_ID","ampGeo":"AMP_GEO","ampState":"AMP_STATE","ampVersion":"AMP_VERSION","ampdocHost":"AMPDOC_HOST","ampdocHostname":"AMPDOC_HOSTNAME","ampdocMeta":"AMPDOC_META","ampdocUrl":"AMPDOC_URL","authdata":"AUTHDATA","availableScreenHeight":"AVAILABLE_SCREEN_HEIGHT","availableScreenWidth":"AVAILABLE_SCREEN_WIDTH","backgroundState":"BACKGROUND_STATE","browserLanguage":"BROWSER_LANGUAGE","canonicalHost":"CANONICAL_HOST","canonicalHostname":"CANONICAL_HOSTNAME","canonicalPath":"CANONICAL_PATH","canonicalUrl":"CANONICAL_URL","clientId":"CLIENT_ID","consentState":"CONSENT_STATE","consentString":"CONSENT_STRING","contentLoadTime":"CONTENT_LOAD_TIME","cookie":"COOKIE","counter":"COUNTER","cumulativeLayoutShift":"CUMULATIVE_LAYOUT_SHIFT","documentCharset":"DOCUMENT_CHARSET","documentReferrer":"DOCUMENT_REFERRER","domInteractiveTime":"DOM_INTERACTIVE_TIME","domainLookupTime":"DOMAIN_LOOKUP_TIME","experimentBranches":"EXPERIMENT_BRANCHES","externalReferrer":"EXTERNAL_REFERRER","firstContentfulPaint":"FIRST_CONTENTFUL_PAINT","firstInputDelay":"FIRST_INPUT_DELAY","firstViewportReady":"FIRST_VIEWPORT_READY","fragmentParam":"FRAGMENT_PARAM","htmlAttr":"HTML_ATTR","incrementalEngagedTime":"INCREMENTAL_ENGAGED_TIME","interactionToNextPaint":"INTERACTION_TO_NEXT_PAINT","largestContentfulPaint":"LARGEST_CONTENTFUL_PAINT","makeBodyVisible":"MAKE_BODY_VISIBLE","navRedirectCount":"NAV_REDIRECT_COUNT","navTiming":"NAV_TIMING","navType":"NAV_TYPE","pageDownloadTime":"PAGE_DOWNLOAD_TIME","pageLoadTime":"PAGE_LOAD_TIME","pageViewId":"PAGE_VIEW_ID","pageViewId64":"PAGE_VIEW_ID_64","queryParam":"QUERY_PARAM","random":"RANDOM","redirectTime":"REDIRECT_TIME","resourceTiming":"RESOURCE_TIMING","screenColorDepth":"SCREEN_COLOR_DEPTH","screenHeight":"SCREEN_HEIGHT","screenWidth":"SCREEN_WIDTH","scrollHeight":"SCROLL_HEIGHT","scrollLeft":"SCROLL_LEFT","scrollTop":"SCROLL_TOP","scrollWidth":"SCROLL_WIDTH","sessionId":"SESSION_ID","sessionCount":"SESSION_COUNT","sessionEngaged":"SESSION_ENGAGED","sessionEventTimestamp":"SESSION_EVENT_TIMESTAMP","sessionTimestamp":"SESSION_TIMESTAMP","serverResponseTime":"SERVER_RESPONSE_TIME","sourceHost":"SOURCE_HOST","sourceHostname":"SOURCE_HOSTNAME","sourcePath":"SOURCE_PATH","sourceUrl":"SOURCE_URL","tcpConnectTime":"TCP_CONNECT_TIME","timestamp":"TIMESTAMP","timezone":"TIMEZONE","timezoneCode":"TIMEZONE_CODE","title":"TITLE","totalEngagedTime":"TOTAL_ENGAGED_TIME","uach":"UACH","userAgent":"USER_AGENT","viewer":"VIEWER","viewportHeight":"VIEWPORT_HEIGHT","viewportWidth":"VIEWPORT_WIDTH"}}');function Ot(t){return"undefined"!=typeof TextEncoder?(new TextEncoder).encode(t):Vt(unescape(encodeURIComponent(t)))}function Vt(t){const i=new Uint8Array(t.length);for(let s=0;s<t.length;s++){const e=t.charCodeAt(s);m(e<=255),i[s]=e}return i}function Nt(t){const i=new Array(t.length);for(let s=0;s<t.length;s++)i[s]=String.fromCharCode(t[s]);return i.join("")}var Ct={"-":"+","_":"/",".":"="},kt={"+":"-","/":"_","=":"."};function Lt(t){return function(t){const i=Nt(t);return btoa(i).replace(/[+/=]/g,(t=>kt[t]))}(Ot(t))}var Dt,xt=(()=>self.AMP.config.urls)(),Ut=new Set(["c","v","a","ad"]),Ht=t=>"string"==typeof t?jt(t):t;function jt(t,i){return Dt||(Dt=self.document.createElement("a")),function(t,i,s){return t.href="",new URL(i,t.href)}(Dt,t)}function Ft(t,i,s){if(!i)return t;const e=t.split("#",2),n=e[0].split("?",2);let r=n[0]+(n[1]?s?`?${i}&${n[1]}`:`?${n[1]}&${i}`:`?${i}`);return r+=e[1]?`#${e[1]}`:"",r}function qt(t,i){return`${encodeURIComponent(t)}=${encodeURIComponent(i)}`}function $t(t){const i=[];for(const e in t){let r=t[e];if(null!=r){r=n(s=r)?s:[s];for(let t=0;t<r.length;t++)i.push(qt(e,r[t]))}}var s;return i.join("&")}function Bt(t,i,s="source"){var e;return $(null!=t,"%s %s must be available",i,s),$("https:"==(e=Ht(e=t)).protocol||"localhost"==e.hostname||"127.0.0.1"==e.hostname||o(e.hostname,".localhost")||/^\/\//.test(t),'%s %s must start with "https://" or "//" or be relative and served from either https or from localhost. Invalid value: %s',i,s,t),t}function Gt(t){return xt.cdnProxyRegex.test(Ht(t).origin)}function Wt(t,i){if(!t||"?"==t)return"";const s=new RegExp(`[?&]${i}\\b[^&]*`,"g"),e=t.replace(s,"").replace(/^[?&]/,"");return e?"?"+e:""}var zt,Yt=(()=>self.AMP.config.urls)(),Kt="-test-amp-cookie-tmp",Xt="None";function Jt(t,i){const s=function(t){try{return t.document.cookie}catch(t){return""}}(t);if(!s)return null;const e=s.split(";");for(let t=0;t<e.length;t++){const s=e[t].trim(),n=s.indexOf("=");if(-1!=n&&w(s.substring(0,n).trim())==i){const t=s.substring(n+1).trim();return w(t,t)}}return null}function Zt(t){const i=t.document.head&&t.document.head.querySelector("meta[name='amp-cookie-scope']");if(i){const s=i.getAttribute("content")||"",e=jt(function(t){if(!Gt(t=Ht(t)))return t.href;const i=t.pathname.split("/"),s=i[1];$(Ut.has(s),"Unknown path prefix in url %s",t.href);const e=i[2],n="s"==e?"https://"+decodeURIComponent(i[3]):"http://"+decodeURIComponent(e);return $(n.indexOf(".")>0,"Expected a . in origin %s",n),i.splice(1,"s"==e?3:2),n+i.join("/")+Wt(t.search,"(amp_(js[^&=]*|gsa|r|kit)|usqp)")+(t.hash||"")}(t.location.href)).origin;return o(e,"."+s)?s:e.split("://")[1]}if(!Gt(t.location.href)){const i=t.location.hostname.split(".");let s=i[i.length-1];const e=function(t){let i=Kt;for(;Jt(t,i);)i=Kt+0;return i}(t);for(let n=i.length-2;n>=0;n--)if(s=i[n]+"."+s,Qt(t,e,"delete",Date.now()+1e3,s),"delete"==Jt(t,e))return Qt(t,e,"delete",Date.now()-1e3,s),s}return null}function Qt(t,i,s,e,n,r,o){"ampproject.org"==n&&(s="delete",e=0);const h=encodeURIComponent(i)+"="+encodeURIComponent(s)+"; path=/"+(n?"; domain="+n:"")+"; expires="+new Date(e).toUTCString()+function(t,i){return i?`; SameSite=${i}`:""}(0,r)+(o?"; Secure":"");try{t.document.cookie=h}catch(t){}}function ti(t){return"string"==typeof t&&t.startsWith("amp-")&&-1!=t.indexOf("{")}var ii=["Webkit","webkit","Moz","moz","ms","O","o"],si={"getPropertyPriority":()=>"","getPropertyValue":()=>""};function ei(t,i,s){if(i.startsWith("--"))return i;zt||(zt=l());let e=zt[i];if(!e||s){if(e=i,void 0===t[i]){const s=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(i),n=function(t,i){for(let s=0;s<ii.length;s++){const e=ii[s]+i;if(void 0!==t[e])return e}return""}(t,s);void 0!==t[n]&&(e=n)}s||(zt[i]=e)}return e}function ni(t,i,s,e,n){const r=ei(t.style,i,n);if(!r)return;const o=e?s+e:s;t.style.setProperty(function(t){const i=t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()));return ii.some((t=>i.startsWith(t+"-")))?`-${i}`:i}(r),o)}function ri(t,i){void 0===i&&(i=t.hasAttribute("hidden")),i?t.removeAttribute("hidden"):t.setAttribute("hidden","")}var oi="unlisten";function hi(t,i,s){const e=function(t,i){let{listeningFors:s}=t;return!s&&i&&(s=t.listeningFors=Object.create(null)),s||null}(t,s);if(!e)return e;let n=e[i];return!n&&s&&(n=e[i]=[]),n||null}function ui(t,i){for(let s=i;s&&s!=s.parent;s=s.parent)if(s==t)return!0;return!1}function ci(t){const i={"sentinel":oi};for(let s=t.length-1;s>=0;s--){const e=t[s];if(!e.frame.contentWindow){t.splice(s,1);const{events:n}=e;for(const t in n)n[t].splice(0,1/0).forEach((t=>{t(i)}))}}}function ai(t,i){return i?t.getAttribute("data-amp-3p-sentinel"):"amp"}function li(t){return t.__AMP_EMBED__}function fi(t){return t.classList.contains("i-amphtml-fie")||!!E(t,".i-amphtml-fie")}function di(t,i){return!(fi(i)||Gt(t.location)||"inabox"==C(t).runtime)}var _i=class{static getTop(t){return t.top}static getLocation(t){return t.location}static getDocumentReferrer(t){return t.document.referrer}static getHostname(t){return t.location.hostname}static getUserAgent(t){return t.navigator.userAgent}static getUserLanguage(t){return t.navigator.userLanguage||t.navigator.language}static getDevicePixelRatio(){return self.devicePixelRatio||1}static getSendBeacon(t){if(t.navigator.sendBeacon)return t.navigator.sendBeacon.bind(t.navigator)}static getXMLHttpRequest(t){return t.XMLHttpRequest}static getImage(t){return t.Image}},mi=null,Ai="*",Pi=/^[a-zA-Z0-9\-_.]+$/,pi="amp-analytics/linker";function Ti(t,i){const s=(e=i)?Object.keys(e).filter((t=>{const i=Pi.test(t);return i||H().error(pi,"Invalid linker key: "+t),i})).map((t=>{return t+Ai+(i=e[t],Lt(String(i)));var i})).join(Ai):"";var e;return""===s?"":[t,Ei(s),s].join(Ai)}function Ei(t,i){const s=i||0;return function(t){mi||(mi=function(){const t=new Array(256);for(let i=0;i<256;i++){let s=i;for(let t=0;t<8;t++)1&s?s=s>>>1^3988292384:s>>>=1;t[i]=s}return t}());const i=Ot(t);let s=-1>>>0;for(let t=0;t<i.length;t++){const e=255&(s^i[t]);s=s>>>8^mi[e]}return(-1^s)>>>0}([function(){const t=(new Date).getTimezoneOffset(),i=_i.getUserLanguage(window);return[_i.getUserAgent(window),t,i].join(Ai)}(),Math.floor(Date.now()/6e4)-s,t].join(Ai)).toString(36)}function gi(t){return function(t){const i=function(t){return Vt(atob(t.replace(/[-_.]/g,(t=>Ct[t]))))}(t);return function(t){if("undefined"!=typeof TextDecoder)return new TextDecoder("utf-8").decode(t);const i=Nt(new Uint8Array(t.buffer||t));return decodeURIComponent(escape(i))}(i)}(String(t))}var Ii="visible",vi="amp-analytics/session-manager",Ri="sessionId",Mi="creationTimestamp",bi="accessTimestamp",Si="engaged",yi="eventTimestamp",wi="count";function Oi(t){return t.accessTimestamp+18e5<Date.now()}function Vi(t){return"amp-session:"+t}function Ni(t,i=1){return{[Ri]:Math.round(1e4*Math.random()),[Mi]:Date.now(),[bi]:Date.now(),[wi]:i,[yi]:void 0,[Si]:t}}function Ci(t){return z(t,"amp-analytics-session")}function ki(t,i="default"){return ft(t).then((t=>t?t.getConsentStringInfo(i):null))}var Li="amp-analytics/variables",Di=/^(?:([^\s]*)(\([^)]*\))|[^]+)$/,xi={1:"sufficient",2:"insufficient",3:"not_required",4:"unknown"},Ui=class{constructor(t,i,s){this.vars=t,this.iterations=void 0===i?2:i,this.noEncode=!!s,this.freezeVars={}}freezeVar(t){this.freezeVars[t]=!0}getVar(t){let i=this.vars[t];return null==i&&(i=""),i}};function Hi(t,i,s){const e=Number(i);let{length:n}=t;return $(_(e),"Start index "+e+"in substr macro should be a number"),s&&(n=Number(s),$(_(n),"Length "+n+" in substr macro should be a number")),t.substr(e,n)}function ji(t,i){return t&&t.length?t:i}function Fi(t,i,s){s||(s="");const e=new RegExp(i,"g");return t.replace(e,s)}function qi(t,i,s){let e=0;s&&(e=parseInt(s,10),(0!=e&&!e||e<0)&&(H().error(Li,"Third argument in MATCH macro must be a number >= 0"),e=0));const n=new RegExp(i),r=t.match(n);return r&&r[e]?r[e]:""}function $i(t,i,s,e){const n=Number(t),r=Number(i);$(!isNaN(n),"CALC macro - left operand must be a number"),$(!isNaN(r),"CALC macro - right operand must be a number");let o=0;switch(s){case"add":o=n+r;break;case"subtract":o=n-r;break;case"multiply":o=n*r;break;case"divide":$(r,"CALC macro - cannot divide by 0"),o=n/r;break;default:H().error(Li,"CALC macro - Invalid operation")}return Ki(e)?Math.round(o):o}function Bi(t){if(null==t)return"";if(n(t))return t.map(Bi).join(",");const{argList:i,name:s}=Gi(String(t));return encodeURIComponent(s)+i}function Gi(t){if(!t)return{name:"",argList:""};const i=t.match(Di);return $(i,"Variable with invalid format found: "+t),{name:i[1]||i[0],argList:i[2]||""}}function Wi(t){return G(t,"amp-analytics-variables")}function zi(t){return z(t,"amp-analytics-variables")}function Yi(t){return function(t,i="default"){return ft(t).then((t=>t?t.whenPolicyResolved(i):null))}(t).then((t=>t?xi[t]:null))}function Ki(t){return"false"!==t&&""!==t&&"0"!==t&&"null"!==t&&"NaN"!==t&&"undefined"!==t}var Xi="amp-analytics/config";function Ji(t,i,s){null==i&&(i={}),$(s||!t||!t.optout||"_gaUserPrefs.ioo"==t.optout||"__gaOptOutExtension"==t.optoutElementId,"optout property is only available to vendor config.");for(const e in t)$(s||"iframePing"!=e,"iframePing config is only available to vendor config."),f(t,e)&&(n(t[e])?(n(i[e])||(i[e]=[]),i[e]=Ji(t[e],i[e],s)):a(t[e])?(a(i[e])||(i[e]={}),i[e]=Ji(t[e],i[e],s)):i[e]=t[e]);return i}function Zi(t){if(!t.requests)return t;for(const s in t.requests)f(t.requests,s)&&(t.requests[s]=a(i=t.requests[s])?i:{"baseUrl":i});var i;return function(t){if(f(t,"requests")&&f(t,"requestOrigin")){const i=t.requestOrigin;for(const s in t.requests)f(t.requests[s],"origin")||(t.requests[s].origin=i)}return t}(t)}var Qi=31536e6,ts=!1,is=/nochunking=1/.test(self.location.hash),ss=s();function es(t,i,s){is?ss.then(i):function(t){return function(t,i,s,e){const n=J(t);tt(Z(n),n,"chunk",s)}(t,0,hs),G(t,"chunk")}(t).run(i,s)}var ns="not_run",rs=class{constructor(t){this.state=ns,this.Qi=t}Xi(t){if("run"!=this.state){this.state="run";try{this.Qi(t)}catch(t){throw this.Zi(t),t}}}ts(){return this.Qi.displayName||this.Qi.name}Zi(t){}ss(){return!1}es(){return!1}},os=class extends rs{constructor(t,i,s){super(t),this.ns=s}Zi(t){var i;q((i=self.document).defaultView),ts||(ts=!0,function(t){!function(t,i){for(const s in i)ni(t,s,i[s])}(t.body,{opacity:1,visibility:"visible","animation":"none"})}(i))}ss(){return this.rs()}es(){return this.ns.hs}rs(){return this.ns.ampdoc.isVisible()}},hs=class{constructor(t){var i;this.ampdoc=t,this.i=t.win,this.os=new class{constructor(){this.Ki=[]}peek(){const t=this.length;return t?this.Ki[t-1].item:null}enqueue(t,i){if(isNaN(i))throw new Error("Priority must not be NaN.");const s=this.Yi(i);this.Ki.splice(s,0,{item:t,priority:i})}Yi(t){let i=-1,s=0,e=this.length;for(;s<=e&&(i=Math.floor((s+e)/2),i!==this.length);)if(this.Ki[i].priority<t)s=i+1;else{if(!(i>0&&this.Ki[i-1].priority>=t))break;e=i-1}return i}forEach(t){let i=this.length;for(;i--;)t(this.Ki[i].item)}dequeue(){const t=this.Ki.pop();return t?t.item:null}get length(){return this.Ki.length}},this.us=this.ls.bind(this),this.cs=0,this.ds=!(!this.i.navigator.scheduling||!this.i.navigator.scheduling.isInputPending),this.fs=!1,this.Ji=this.i.document.documentElement.hasAttribute("i-amphtml-no-boilerplate"),this.i.addEventListener("message",(t=>{"amp-macro-task"==pt(t)&&this.ls(null)})),this.hs=!1,(i=t,z(i,"viewer")).then((()=>{this.hs=!0})),t.onVisibilityChanged((()=>{t.isVisible()&&this.ps()}))}run(t,i){const s=new rs(t);this._s(s,i)}runForStartup(t){const i=new os(t,this.i,this);this._s(i,Number.POSITIVE_INFINITY)}_s(t,i){this.os.enqueue(t,i),this.ps()}As(t){let i=this.os.peek();for(;i&&i.state!==ns;)this.os.dequeue(),i=this.os.peek();return i&&t&&this.os.dequeue(),i}ls(t){const i=this.As(!0);if(!i)return this.fs=!1,this.cs=0,!1;let s;try{s=Date.now(),i.Xi(t)}finally{ss.then().then().then().then().then().then().then().then().then((()=>{this.fs=!1,this.cs+=Date.now()-s,this.ps()}))}return!0}gs(t){if(this.Ji&&(this.ds?this.i.navigator.scheduling.isInputPending():this.cs>5))return this.cs=0,void this.Ps();ss.then((()=>{this.us(t)}))}ps(){if(this.fs)return;const t=this.As();return t?t.ss()?(this.fs=!0,void this.gs(null)):void(t.es()&&this.i.requestIdleCallback?function(t,i,s,e){const n=Date.now();t.requestIdleCallback((function i(s){if(s.timeRemaining()<15){const r=2e3-(Date.now()-n);r<=0||s.didTimeout?e(s):t.requestIdleCallback(i,{timeout:r})}else e(s)}),{timeout:2e3})}(this.i,0,0,this.us):this.Ps()):void 0}Ps(){this.i.postMessage("amp-macro-task","*")}},us="amp-analytics/cookie-writer",cs={"referrerDomains":!0,"enabled":!0,"cookiePath":!0,"cookieMaxAge":!0,"cookieSecure":!0,"cookieDomain":!0,"sameSite":!0,"SameSite":!0,"secure":!0},as=class{constructor(){this.Vt=null}add(t){return this.Vt||(this.Vt=[]),this.Vt.push(t),()=>{this.remove(t)}}remove(t){this.Vt&&function(t,i){const s=t.indexOf(i);-1!=s&&t.splice(s,1)}(this.Vt,t)}removeAll(){this.Vt&&(this.Vt.length=0)}fire(t){if(this.Vt)for(const i of this.Vt.slice())i(t)}getHandlerCount(){var t,i;return null!==(t=null===(i=this.Vt)||void 0===i?void 0:i.length)&&void 0!==t?t:0}},ls="video-session-visible",fs="video-seconds-played",ds=["video-ended","video-pause","video-play","video-session","video-session-visible","video-seconds-played","video-hosted-custom","video-percentage-played","video-ad-start","video-ad-end"],_s=/^vars(.+)/,ms=function(){},As="amp-analytics/events",Ps="click",ps="browser-event",Ts="custom",Es="hidden",gs="ini-load",Is="render-start",vs="scroll",Rs="story",Ms="timer",bs="video",Ss="visible",ys=["ampdoc","embed"],ws=Object.freeze({[Ps]:{name:Ps,allowedFor:ys.concat(["timer"]),klass:function(t){return new Us(t)}},[ps]:{name:ps,allowedFor:ys.concat(["timer"]),klass:function(t){return new Ls(t)}},[Ts]:{name:Ts,allowedFor:ys.concat(["timer"]),klass:function(t){return new Ds(t)}},[Es]:{name:Ss,allowedFor:ys.concat(["timer"]),klass:function(t){return new Bs(t)}},[gs]:{name:gs,allowedFor:ys.concat(["timer","visible"]),klass:function(t){return new Fs(t)}},[Is]:{name:Is,allowedFor:ys.concat(["timer","visible"]),klass:function(t){return new js(t)}},[vs]:{name:vs,allowedFor:ys.concat(["timer"]),klass:function(t){return new Hs(t)}},[Rs]:{name:Rs,allowedFor:ys,klass:function(t){return new xs(t)}},[Ms]:{name:Ms,allowedFor:ys,klass:function(t){return new qs(t)}},[bs]:{name:bs,allowedFor:ys.concat(["timer"]),klass:function(t){return new $s(t)}},[Ss]:{name:Ss,allowedFor:ys.concat(["timer"]),klass:function(t){return new Bs(t)}}});function Os(t){$(!n(t)||new Set(t).size===t.length,"Cannot have duplicate selectors in selectors list: %s",t)}function Vs(t){return t.startsWith("video")?bs:"blur"===(i=t)||"change"===i?ps:t.startsWith("story")?Rs:function(t){return"click"===(i=t)||"browser-event"===i||"custom"===i||"hidden"===i||"ini-load"===i||"render-start"===i||"scroll"===i||"story"===i||"timer"===i||"video"===i||"visible"===i;var i}(t)?f(ws,t)?ws[t].name:t:Ts;var i}function Ns(t){const i={};return Object.keys(ws).forEach((s=>{f(ws,s)&&-1!=ws[s].allowedFor.indexOf(t)&&(i[s]=ws[s].klass)})),i}var Cs=class{constructor(t,i,s={},e=!0){this.target=t,this.type=i,this.vars=e?function(t,i){const s=I(t,void 0,_s);return d(s,i,0),s}(t,s):s}},ks=class{constructor(t){this.root=t}dispose(){}add(t,i,s,e){}},Ls=class extends ks{constructor(t){super(t),this.QAt=new as,this.tTt={},this.iTt=this.QAt.fire.bind(this.QAt),this.sTt=function(t,i,s){let e=0,n=0,r=null;function o(){e=0;const s=500-(t.Date.now()-n);var h;s>0?e=t.setTimeout(o,s):(h=r,r=null,i.apply(null,h))}return function(...i){n=t.Date.now(),r=i,e||(e=t.setTimeout(o,500))}}(this.root.ampdoc.win,this.iTt)}dispose(){const t=this.root.getRoot();Object.keys(this.tTt).forEach((i=>{t.removeEventListener(i,this.sTt)})),this.iTt=null,this.QAt=null}add(t,i,s,e){$(function(t,i){const s=function(t){var i,s,e,r,o;if(t[yt])return t[yt];t[yt]=l();const h=t[yt];m(h);const u=St(St({},null!==(i=t.AMP_CONFIG)&&void 0!==i?i:{}),null!==(s=t.AMP_EXP)&&void 0!==s?s:A((null===(e=t.__AMP_EXP)||void 0===e?void 0:e.textContent)||"{}"));for(const t in u){const i=u[t];"number"==typeof i&&i>=0&&i<=1&&(h[t]=Math.random()<i)}const c=null===(r=t.AMP_CONFIG)||void 0===r?void 0:r["allow-doc-opt-in"];if(n(c)&&c.length){const i=t.document.head.querySelector('meta[name="amp-experiments-opt-in"]');if(i){var a;const t=(null===(a=i.getAttribute("content"))||void 0===a?void 0:a.split(","))||[];for(const i of t)c.includes(i)&&(h[i]=!0)}}Object.assign(h,function(t){var i;let s="";try{var e;"localStorage"in t&&(s=null!==(e=t.localStorage.getItem("amp-experiment-toggles"))&&void 0!==e?e:"")}catch(t){}const n=(null===(i=s)||void 0===i?void 0:i.split(/\s*,\s*/g))||[],r=l();for(const t of n)t&&("-"==t[0]?r[t.substr(1)]=!1:r[t]=!0);return r}(t));const f=null===(o=t.AMP_CONFIG)||void 0===o?void 0:o["allow-url-opt-in"];if(n(f)&&f.length){const i=O(t.location.originalHash||t.location.hash);for(const t of f){const s=i[`e-${t}`];"1"==s&&(h[t]=!0),"0"==s&&(h[t]=!1)}}return h}(t);return!!s["analytics-browser-events"]}(this.root.ampdoc.win),'expected global "analytics-browser-events" experiment to be enabled');const{"on":r,"selectionMethod":o=null,"selector":h}=s;$(null==h?void 0:h.length,"Missing required selector on browser event trigger"),Os(h);const u=this.root.getElements(t,h,o,!1);return this.tTt[r]||(this.root.getRootElement().addEventListener(r,this.sTt,!0),this.tTt[r]=!0),this.QAt.add((t=>{t.type===r&&u.then((i=>{i.forEach((i=>{const s=t.target;i.contains(s)&&e(new Cs(i,r,{}))}))}))}))}},Ds=class extends ks{constructor(t){super(t),this.QAt={},this.eTt={},this.nTt={},setTimeout((()=>{this.eTt=void 0}),1e4)}dispose(){this.eTt=void 0,this.nTt=void 0;for(const t in this.QAt)this.QAt[t].removeAll()}add(t,i,s,e){let n=s.selector;n||(n=":root");const r=s.selectionMethod||null,o=this.root.getElement(t,n,r),h=i.startsWith("sandbox-"),u=h?this.nTt&&this.nTt[i]:this.eTt&&this.eTt[i];if(u){const t=u.length;o.then((s=>{setTimeout((()=>{for(let i=0;i<t;i++){const t=u[i];s.contains(t.target)&&e(t)}h&&(this.nTt[i]=void 0)}),1)}))}let c=this.QAt[i];return c||(c=new as,this.QAt[i]=c),this.QAt[i].add((t=>{o.then((i=>{i.contains(t.target)&&e(t)}))}))}trigger(t){const i=t.type,s=i.startsWith("sandbox-"),e=this.QAt[i];e&&(e.fire(t),s)||(s?(this.nTt[i]=this.nTt[i]||[],this.nTt[i].push(t)):this.eTt&&(this.eTt[i]=this.eTt[i]||[],this.eTt[i].push(t)))}},xs=class extends Ds{constructor(t){super(t)}add(t,i,s,e){const n=this.root.getRootElement(),r=this.eTt&&this.eTt[i];if(r){const t=r.length;for(let i=0;i<t;i++){const t=r[i];this.rTt(t,n,s,e)}}let o=this.QAt[i];return o||(o=new as,this.QAt[i]=o),this.QAt[i].add((t=>{this.rTt(t,n,s,e)}))}rTt(t,i,s,e){const n=t.type,r=t.vars,o=s.storySpec||{},h=void 0===o.repeat||o.repeat,u=r.eventDetails,c=s.tagName;c&&u.tagName&&c.toLowerCase()!==u.tagName||!1===h&&u.repeated||e(new Cs(i,n,r))}trigger(t){const i=t.type,s=this.QAt[i];s&&s.fire(t),this.eTt&&(this.eTt[i]=this.eTt[i]||[],this.eTt[i].push(t))}},Us=class extends ks{constructor(t){super(t),this.oTt=new as,this.hTt=this.oTt.fire.bind(this.oTt),this.root.getRoot().addEventListener("click",this.hTt)}dispose(){this.root.getRoot().removeEventListener("click",this.hTt),this.oTt.removeAll()}add(t,i,s,e){const n=$(s.selector,"Missing required selector on click trigger"),r=s.selectionMethod||null;return this.oTt.add(this.root.createSelectiveListener(this.$c.bind(this,e),t.parentElement||t,n,r))}$c(t,i,s){t(new Cs(i,"click"))}},Hs=class extends ks{constructor(t){super(t),this.pu=t,this.uTt=null}dispose(){null!==this.uTt&&(this.pu.getScrollManager().removeScrollHandler(this.uTt),this.uTt=null)}add(t,i,s,e){if(!s.scrollSpec)return H().error(As,"Missing scrollSpec on scroll trigger."),ms;if(!Array.isArray(s.scrollSpec.verticalBoundaries)&&!Array.isArray(s.scrollSpec.horizontalBoundaries))return H().error(As,"Boundaries are required for the scroll trigger to work."),ms;const n=this.cTt(s.scrollSpec.verticalBoundaries),r=this.cTt(s.scrollSpec.horizontalBoundaries),o=!!s.scrollSpec.useInitialPageSize;return this.uTt=this.Mf.bind(this,r,n,o,e),this.pu.getScrollManager().addScrollHandler(this.uTt)}Mf(t,i,s,e,n){const{scrollHeight:r,scrollWidth:o}=s?n.initialSize:n;this.aTt(i,100*(n.top+n.height)/r,"verticalScrollBoundary",e),this.aTt(t,100*(n.left+n.width)/o,"horizontalScrollBoundary",e)}cTt(t){const i={};if(!t||!Array.isArray(t))return i;for(let s=0;s<t.length;s++){let e=t[s];if("number"!=typeof e||!isFinite(e))return H().error(As,"Scroll trigger boundaries must be finite."),i;e=Math.min(5*Math.round(e/5),100),i[e]=!1}return i}aTt(t,i,s,e){if(i)for(const n in t){if(!f(t,n))continue;const r=parseInt(n,10);if(r>i||t[r])continue;t[r]=!0;const o={};o[s]=n,e(new Cs(this.pu.getRootElement(),vs,o,!1))}}},js=class extends ks{constructor(t){super(t)}dispose(){}add(t,i,s,e){let n,r;const o=s.selector||":root";if(":root"==o||":host"==o)n=this.root.getRootElement(),r=this.getRootSignal(i);else{const e=s.selectionMethod;r=this.root.getAmpElement(t.parentElement||t,o,e).then((t=>(n=t,this.getElementSignal(i,n))))}return r.then((()=>{e(new Cs(n,i))})),ms}getRootSignal(t){return this.root.signals().whenSignal(t)}getElementSignal(t,i){return"function"!=typeof i.signals?s():i.signals().whenSignal(t)}},Fs=class extends ks{constructor(t){super(t)}dispose(){}add(t,i,s,e){let n,r;const o=s.selector||":root";if(":root"==o||":host"==o)n=this.root.getRootElement(),r=this.getRootSignal();else{const i=s.selectionMethod;r=this.root.getAmpElement(t.parentElement||t,o,i).then((t=>(n=t,this.getElementSignal("ini-load",n))))}return r.then((()=>{e(new Cs(n,i))})),ms}getRootSignal(){return this.root.whenIniLoaded()}getElementSignal(t,i){if("function"!=typeof i.signals)return s();const e=i.signals();return Promise.race([e.whenSignal("ini-load"),e.whenSignal("load-end")])}},qs=class extends ks{constructor(t){super(t),this.lTt={},this.fTt=1}getTrackedTimerKeys(){return Object.keys(this.lTt)}dispose(){this.getTrackedTimerKeys().forEach((t=>{this.dTt(t)}))}add(t,i,s,e){const n=s.timerSpec;$(n&&"object"==typeof n,"Bad timer specification");const r="startSpec"in n?n.startSpec:null;$(!r||"object"==typeof r,"Bad timer start specification");const o="stopSpec"in n?n.stopSpec:null;$(!r&&!o||"object"==typeof o,"Bad timer stop specification");const h=this._Tt();let u,c;if(r){const s=this.mTt(r);$(s,"Cannot track timer start"),u=s.add.bind(s,t,r.on,r,this.ATt.bind(this,h,i,e))}if(o){const s=this.mTt(o);$(s,"Cannot track timer stop"),c=s.add.bind(s,t,o.on,o,this.ATt.bind(this,h,i,e))}const a=new class{constructor(t,i,s){this.PTt=void 0,$("interval"in t,"Timer interval specification required"),this.pTt=Number(t.interval)||0,$(this.pTt>=.5,"Bad timer interval specification"),this.TTt="maxTimerLength"in t?Number(t.maxTimerLength):7200,$(this.TTt>0,"Bad maxTimerLength specification"),this.ETt="maxTimerLength"in t,this.gTt=!("immediate"in t)||Boolean(t.immediate),this.ITt=null,this.vTt=null,this.RTt=null,this.MTt=i||null,this.bTt=s||null,this.zn=void 0,this.STt=void 0}init(t){this.MTt?this.yTt():t()}dispose(){this.wTt(),this.OTt()}yTt(){this.MTt&&(this.vTt=this.MTt())}OTt(){this.vTt&&(this.vTt(),this.vTt=null)}VTt(){if(this.bTt)try{this.RTt=this.bTt()}catch(t){throw this.dispose(),t}}wTt(){this.RTt&&(this.RTt(),this.RTt=null)}isRunning(){return!!this.PTt}startIntervalInWindow(t,i,s){this.isRunning()||(this.zn=Date.now(),this.STt=void 0,this.ITt=i,this.PTt=t.setInterval((()=>{i()}),1e3*this.pTt),(!this.bTt||this.bTt&&this.ETt)&&t.setTimeout((()=>{s()}),1e3*this.TTt),this.OTt(),this.gTt&&i(),this.VTt())}NTt(t){this.isRunning()&&(this.ITt(),this.ITt=null,t.clearInterval(this.PTt),this.PTt=void 0,this.STt=void 0,this.wTt(),this.yTt())}CTt(){return this.zn?Date.now()-(this.STt||this.zn):0}getTimerVars(){let t=0;return this.isRunning()&&(t=this.CTt(),this.STt=Date.now()),{"timerDuration":t,"timerStart":this.zn||0}}}(n,u,c);return this.lTt[h]=a,a.init(this.kTt.bind(this,h,i,e)),()=>{this.dTt(h)}}_Tt(){return++this.fTt}mTt(t){const i=Vs(H().assertString(t.on));return this.root.getTrackerForAllowlist(i,Ns("timer"))}ATt(t,i,s){const e=this.lTt[t];e&&(e.isRunning()?this.NTt(t):this.kTt(t,i,s))}kTt(t,i,s){this.lTt[t].startIntervalInWindow(this.root.ampdoc.win,(()=>{s(this.LTt(t,i))}),this.dTt.bind(this,t))}NTt(t){this.lTt[t].NTt(this.root.ampdoc.win)}LTt(t,i){return new Cs(this.root.getRootElement(),i,this.lTt[t].getTimerVars(),!1)}dTt(t){this.lTt[t]&&(this.NTt(t),this.lTt[t].dispose(),delete this.lTt[t])}},$s=class extends ks{constructor(t){super(t),this.DTt=new as,this.iTt=this.DTt.fire.bind(this.DTt),ds.forEach((t=>{this.root.getRoot().addEventListener(t,this.iTt)}))}dispose(){const t=this.root.getRoot();ds.forEach((i=>{t.removeEventListener(i,this.iTt)})),this.iTt=null,this.DTt=null}add(t,i,s,e){const n=s.videoSpec||{},r=$(s.selector||n.selector,"Missing required selector on video trigger");$(r.length,"Missing required selector on video trigger"),Os(r);const o=s.selectionMethod||null,h=this.root.getElements(t,r,o,!1),u=n["end-session-when-invisible"],c=n["exclude-autoplay"],a=n.interval,l=n.percentages,f=s.on;let d=0,m=0;return this.DTt.add((t=>{const{type:i}=t,s=pt(t),n=function(t,i){return t==ls?"video-session":"video-hosted-custom"==t?i["__amp:eventType"]:t}(i,s);if(n!==f)return;if(n===fs&&!a)return void H().error(As,"video-seconds-played requires interval spec with non-zero value");if(n===fs&&(d++,d%a!=0))return;if("video-percentage-played"===n){if(!l)return void H().error(As,"video-percentage-played requires percentages spec.");for(let t=0;t<l.length;t++){const i=l[t];if(i<=0||i%5!=0)return void H().error(As,"Percentages must be set in increments of %s with non-zero values",5)}const t=s.normalizedPercentage,i=parseInt(t,10);if(q(_(i)),q(i%5==0),m==i&&l.length>1)return;if(l.indexOf(i)<0)return;m=i}if(i===ls&&!u)return;if(c&&"playing_auto"===s.state)return;const r=t.target;h.then((t=>{t.forEach((t=>{if(!t.contains(r))return;const i=function(t){if(!t)return{};const i=St({},t);return delete i["__amp:eventType"],i}(s);e(new Cs(t,n,i))}))}))}))}},Bs=class extends ks{constructor(t){super(t),this.xTt={}}dispose(){}add(t,i,s,e){const n=s.visibilitySpec||{},r=s.selector||n.selector,o=n.waitFor;let h=n.reportWhen,u=null;h&&$(!n.repeat,"reportWhen and repeat are mutually exclusive."),i===Es&&(h&&H().error(As,'ReportWhen should not be defined when eventType is "hidden"'),h="documentHidden");const c=this.root.getVisibilityManager();if("documentHidden"==h?u=this.UTt.bind(this):"documentExit"==h?u=this.HTt.bind(this):$(!h,'reportWhen value "%s" not supported.',h),!r||":root"==r||":host"==r){const t=o||(r?"ini-load":"none");return c.listenRoot(n,this.getReadyPromise(t),u,this.jTt.bind(this,i,e,this.root.getRootElement()))}const a=s.selectionMethod||n.selectionMethod;Os(r);const l=this.root.getElements(t.parentElement||t,r,a).then((t=>{const s=[];for(let r=0;r<t.length;r++)s.push(c.listenElement(t[r],n,this.getReadyPromise(o,t[r]),u,this.jTt.bind(this,i,e,t[r])));return s}));return function(){l.then((t=>{for(let i=0;i<t.length;i++)t[i]()}))}}UTt(){const{ampdoc:t}=this.root;return t.isVisible()?new Promise((i=>{t.onVisibilityChanged((()=>{t.isVisible()||i()}))})):s()}HTt(){const t=new e,{win:i}=this.root.ampdoc;let s,n;return this.FTt()||i.addEventListener("unload",s=()=>{i.removeEventListener("unload",s),t.resolve()}),i.addEventListener("pagehide",n=()=>{i.removeEventListener("pagehide",n),t.resolve()}),t.promise}FTt(){return"onpagehide"in this.root.ampdoc.win}getReadyPromise(t,i){if(i&&(function(t){const i=t.tagName;return i.startsWith("AMP-")&&!("AMP-STICKY-AD-TOP-PADDING"==i||"AMP-BODY"==i)}(i)?t=t||"ini-load":$(!t||"none"==t,"waitFor for non-AMP elements must be none or null. Found %s",t)),!t||"none"==t)return null;const s=Ns("visible");$(void 0!==s[t],"waitFor value %s not supported",t);const e=this.xTt[t]||this.root.getTrackerForAllowlist(t,s);return e?(this.xTt[t]=e,i?e.getElementSignal(t,i):e.getRootSignal(t)):null}jTt(t,i,s,e){const n=I(s,void 0,_s);for(const t in n)e[t]=n[t];i(new Cs(s,t,e,!1))}},Gs="inside";function Ws(t,i,s,e){return{left:t,top:i,width:s,height:e,bottom:i+e,right:t+s,x:t,y:i}}function zs(t,i,s){const e=(n={top:s,bottom:s+i.getHeight(),left:0,right:i.getWidth()},Ws(Number(n.left),Number(n.top),Number(n.width),Number(n.height)));var n,r,o;return o=e,(r=t).top<=o.bottom&&o.top<=r.bottom&&r.left<=o.right&&o.left<=r.right?Gs:function(t,i){return t.top<i.top?"top":t.bottom>i.bottom?"bottom":Gs}(t,e)}function Ys(t){const i=function(t){const i=[];if(!t)return i;let s,e=t;i.push(e);for(let t=0;t<50;t++)if(s=e.parentNode||e.parentElement,s&&1==s.nodeType)e=s,i.push(e);else{if(!s||9!=s.nodeType)break;if(s=e.ownerDocument.defaultView.frameElement,!s||1!=s.nodeType)break;e=s,i.push(e)}return i}(t.parentElement);i.push(t);let s,e=1;for(let t=0;t<i.length;t++)if(s=Ks(i[t]),s<e&&(e=s),0===e)return e;return e}function Ks(t){const i=window;if(!t)return 1;const{opacity:s,visibility:e}=function(t,i){return t.getComputedStyle(i)||si}(i,t);if("hidden"===e)return 0;const n=""===s?1:parseFloat(s);return isNaN(n)?1:n}var Xs=class{constructor(t,i){this.qTt=i,this.$Tt={"visiblePercentageMin":Number(t.visiblePercentageMin)/100||0,"visiblePercentageMax":Number(t.visiblePercentageMax)/100||1,"totalTimeMin":Number(t.totalTimeMin)||0,"totalTimeMax":Number(t.totalTimeMax)||1/0,"continuousTimeMin":Number(t.continuousTimeMin)||0,"continuousTimeMax":Number(t.continuousTimeMax)||1/0},"0"===String(t.visiblePercentageMax).trim()&&(this.$Tt.visiblePercentageMax=0),this.BTt=void 0!==t.reportWhen,this.GTt=!0===t.repeat,this.WTt=new as;const s=new e;this.zTt=s.promise,this.YTt=s.resolve,this.zTt.then((()=>{this.WTt.fire()})),this.KTt=[],this.XTt=Date.now(),this.ci=!0,this.JTt=!0,this.ZTt=null,this.QTt=null,this.tEt=!1,this.iEt=!1,this.sEt=0,this.eEt=0,this.nEt=0,this.rEt=0,this.oEt=0,this.yu=0,this.ii=0,this.hEt=0,this.uEt=0,this.cEt=0,this.aEt=0,this.lEt=0,this.fEt=!1,this.dEt=!1,this._Et=null}Ws(){q(!this.YTt);const t=new e;this.zTt=t.promise,this.YTt=t.resolve,this.zTt.then((()=>{this.WTt.fire()})),this._Et=null,this.iEt=!1,this.tEt=!1,this.sEt=0,this.eEt=0,this.nEt=0,this.yu=0,this.rEt=0,this.oEt=0,this.ii=0,this.uEt=0,this.cEt=0,this.aEt=0,this.dEt=!1}maybeDispose(){this.GTt||this.dispose()}dispose(){this.QTt&&(clearTimeout(this.QTt),this.QTt=null),this._Et&&(clearTimeout(this._Et),this._Et=null),this.KTt.forEach((t=>{t()})),this.KTt.length=0,this.YTt=null,this.WTt&&(this.WTt.removeAll(),this.WTt=null)}unsubscribe(t){this.KTt.push(t)}onTriggerEvent(t){this.WTt&&this.WTt.add(t),this.zTt&&!this.YTt&&t()}setReady(t){this.ci=t,this.update()}setReportReady(t){this.JTt=!1,this.ZTt=t}mEt(){return this.ci?this.qTt():0}update(){this.$t(this.mEt())}getState(t){return{"firstSeenTime":Js(this.rEt,t),"lastSeenTime":Js(this.oEt,t),"lastVisibleTime":Js(this.ii,t),"firstVisibleTime":Js(this.yu,t),"maxContinuousVisibleTime":this.eEt,"totalVisibleTime":this.nEt,"loadTimeVisibility":100*this.hEt||0,"minVisiblePercentage":100*this.uEt,"maxVisiblePercentage":100*this.cEt}}$t(t){if(this.dEt)this.AEt(t)||this.Ws();else if(this.YTt)if(this.PEt(t)||this.BTt){if(this.QTt&&(clearTimeout(this.QTt),this.QTt=null),this.JTt)this.YTt(),this.YTt=null,this.GTt&&(this.dEt=!0,this.sEt=0);else if(this.ZTt){const t=this.ZTt();this.ZTt=null,t.then((()=>{this.JTt=!0,this.update()}))}}else if(this.tEt&&!this.QTt){const t=this.pEt();t>0&&(this.QTt=setTimeout((()=>{this.QTt=null,this.update()}),t))}else!this.tEt&&this.QTt&&(clearTimeout(this.QTt),this.QTt=null)}AEt(t){return q(t>=0&&t<=1),1==this.$Tt.visiblePercentageMin?1==t:0==this.$Tt.visiblePercentageMax?0==t:t>this.$Tt.visiblePercentageMin&&t<=this.$Tt.visiblePercentageMax}PEt(t){q(t>=0&&t<=1);const i=Date.now();t>0&&(this.rEt=this.rEt||i,this.oEt=i,!this.hEt&&i-this.XTt<300&&(this.hEt=t));const s=this.tEt,e=this.aEt?i-this.aEt:0;return this.tEt=this.AEt(t),this.tEt?(this.iEt=!0,s?(this.nEt+=e,this.sEt+=e,this.eEt=Math.max(this.eEt,this.sEt)):(q(!this.aEt),this.yu=this.yu||i),this.aEt=i,this.uEt=this.uEt>0?Math.min(this.uEt,t):t,this.cEt=Math.max(this.cEt,t),this.ii=i):s&&(q(this.aEt>0),this.eEt=Math.max(this.eEt,this.sEt+e),this.aEt=0,this.nEt+=e,this.sEt=0,this.ii=i),this.iEt&&this.nEt>=this.$Tt.totalTimeMin&&this.nEt<=this.$Tt.totalTimeMax&&this.eEt>=this.$Tt.continuousTimeMin&&this.eEt<=this.$Tt.continuousTimeMax}maybeSetInitialScrollDepth(t){this.fEt||(this.lEt=t,this.fEt=!0)}getInitialScrollDepth(){return this.lEt}pEt(){const t=Math.max(this.$Tt.continuousTimeMin-this.sEt,0),i=Math.max(this.$Tt.totalTimeMin-this.nEt,0),s=Math.max(t,i);return Math.min(s,t||1/0,i||1/0)}};function Js(t,i){return t>=i?t-i:0}var Zs="amp-analytics/visibility-manager",Qs="__AMP_VIS",te=[0,.05,.1,.15,.2,.25,.3,.35,.4,.45,.5,.55,.6,.65,.7,.75,.8,.85,.9,.95,1],ie=1;function se(t){let i=t.__AMP_VIS_ID;return i||(i=++ie,t.__AMP_VIS_ID=i),i}function ee(t){return t[Qs]||(t[Qs]=function(t){const i=ot(t),s=X(t),e=s&&li(s),n=s&&function(t){if(Node.prototype.getRootNode)return t.getRootNode();let i;for(i=t;i.parentNode&&(!(s=i)||"I-AMPHTML-SHADOW-ROOT"!=s.tagName&&(11!=s.nodeType||"[object ShadowRoot]"!==Object.prototype.toString.call(s)));i=i.parentNode);var s;return i}(s);return e&&n?new oe(ee(n),e):new re(i)}(t)),t[Qs]}var ne=class{constructor(t,i){this.parent=t,this.ampdoc=i,this.TEt=0,this.EEt=[],this.I5=null,this.KTt=[],this.gEt=0,this.parent&&this.parent.IEt(this);const s=_t(this.ampdoc);s.onChanged((()=>{this.maybeUpdateMaxScrollDepth(s.getScrollTop())}))}IEt(t){this.I5||(this.I5=[]),this.I5.push(t)}vEt(t){if(this.I5){const i=this.I5.indexOf(t);-1!=i&&this.I5.splice(i,1)}}dispose(){this.setRootVisibility(0);for(let t=this.EEt.length-1;t>=0;t--)this.EEt[t].dispose();if(this.KTt.forEach((t=>{t()})),this.KTt.length=0,this.parent&&this.parent.vEt(this),this.I5)for(let t=0;t<this.I5.length;t++)this.I5[t].dispose()}unsubscribe(t){this.KTt.push(t)}getStartTime(){}isBackgrounded(){}isBackgroundedAtStart(){}getRootMinOpacity(){}getRootLayoutBox(){}getRootVisibility(){return this.parent?this.parent.getRootVisibility()>0?this.TEt:0:this.TEt}setRootVisibility(t){if(this.TEt=t,this.REt(),this.I5)for(let t=0;t<this.I5.length;t++)this.I5[t].REt()}maybeUpdateMaxScrollDepth(t){t>this.gEt&&(this.gEt=t)}getMaxScrollDepth(){return this.gEt}REt(){for(let t=0;t<this.EEt.length;t++)this.EEt[t].update()}listenRoot(t,i,s,e){const n=this.getRootVisibility.bind(this);return this.MEt(n,t,i,s,e)}listenElement(t,i,s,e,n){const r=this.getElementVisibility.bind(this,t);return this.MEt(r,i,s,e,n,t)}MEt(t,i,s,e,r,o){if(i.visiblePercentageThresholds&&null==i.visiblePercentageMin&&null==i.visiblePercentageMax){const h=[],u=i.visiblePercentageThresholds;if(!u||!n(u))return H().error(Zs,"invalid visiblePercentageThresholds"),()=>{};for(let c=0;c<u.length;c++){const a=u[c];if(!n(a)||2!=a.length){H().error(Zs,"visiblePercentageThresholds entry length is not 2");continue}if(!_(a[0])||!_(a[1])){H().error(Zs,"visiblePercentageThresholds entry is not valid number");continue}const l=Number(a[0]),f=Number(a[1]);if(l<0||f>100||l>f||l==f&&100!=l&&0!=f){H().error(Zs,"visiblePercentageThresholds entry invalid min/max value");continue}const d=i;d.visiblePercentageMin=l,d.visiblePercentageMax=f;const m=new Xs(d,t,_t(this.ampdoc));h.push(this.lR(m,i,s,e,r,o))}return()=>{h.forEach((t=>t()))}}const h=new Xs(i,t,_t(this.ampdoc));return this.lR(h,i,s,e,r,o)}lR(t,i,s,e,n,r){e&&t.setReportReady(e);const o=_t(this.ampdoc),h=o.getScrollTop();return this.maybeUpdateMaxScrollDepth(h),s?(t.setReady(!1),s.then((()=>{t.setReady(!0),t.maybeSetInitialScrollDepth(h)}))):t.maybeSetInitialScrollDepth(h),t.onTriggerEvent((()=>{const i=this.getStartTime(),s=t.getState(i);let e;if(s.backgrounded=this.isBackgrounded()?1:0,s.backgroundedAtStart=this.isBackgroundedAtStart()?1:0,s.totalTime=Date.now()-i,r){s.elementId=r.id,s.opacity=Ys(r),e=o.getLayoutRect(r);const t=this.getElementVisibility(r),i=this.getElementIntersectionRect(r);Object.assign(s,{"intersectionRatio":t,"intersectionRect":JSON.stringify(i)})}else s.opacity=this.getRootMinOpacity(),s.intersectionRatio=this.getRootVisibility(),e=this.getRootLayoutBox();t.maybeDispose(),e&&(Object.assign(s,{"elementX":e.left,"elementY":e.top,"elementWidth":e.width,"elementHeight":e.height}),s.initialScrollDepth=zs(e,o,t.getInitialScrollDepth()),s.maxScrollDepth=zs(e,o,this.getMaxScrollDepth())),n(s)})),this.EEt.push(t),t.unsubscribe((()=>{const i=this.EEt.indexOf(t);-1!=i&&this.EEt.splice(i,1)})),r&&t.unsubscribe(this.observe(r,(()=>t.update()))),t.update(),function(){t.dispose()}}observe(t,i){}getElementVisibility(t){}getElementIntersectionRect(t){}},re=class extends ne{constructor(t){if(super(null,t),this.Uu=_t(t),this.bEt=!t.isVisible(),this.SEt=this.isBackgrounded(),this.yEt=l(),this.Ng=null,"inabox"==C(this.ampdoc.win).runtime){const t=this.ampdoc.getRootNode(),i=t.documentElement||t.body||t;this.unsubscribe(this.observe(i,this.setRootVisibility.bind(this)));const s=()=>{const t=se(i),s=this.yEt[t];s&&(this.ampdoc.win.innerHeight<1||this.ampdoc.win.innerWidth<1?s.isVisible=!1:s.isVisible=!0,this.setRootVisibility(s.isVisible?s.intersectionRatio:0))};this.ampdoc.win.addEventListener("resize",s),this.unsubscribe((()=>{this.ampdoc.win.removeEventListener("resize",s)}))}else this.setRootVisibility(this.ampdoc.isVisible()?1:0),this.unsubscribe(this.ampdoc.onVisibilityChanged((()=>{const t=this.ampdoc.isVisible();t||(this.bEt=!0),this.setRootVisibility(t?1:0)})))}dispose(){super.dispose(),this.Ng&&(this.Ng.disconnect(),this.Ng=null)}getStartTime(){return this.ampdoc.getFirstVisibleTime()}isBackgrounded(){return this.bEt}isBackgroundedAtStart(){return this.SEt}getRootMinOpacity(){const t=this.ampdoc.getRootNode();return Ys(t.documentElement||t.body||t)}getRootLayoutBox(){const t=this.ampdoc.getRootNode(),i=t.documentElement||t.body||t;return this.Uu.getLayoutRect(i)}observe(t,i){const s=se(t);let e=this.yEt[s];return e?e.intersectionRatio>0&&e.isVisible&&i(e.intersectionRatio):(e={element:t,intersectionRatio:0,intersectionRect:null,isVisible:!1,boundingClientRect:null,listeners:[]},this.yEt[s]=e),e.listeners.push(i),this.wEt().observe(t),()=>{const e=this.yEt[s];if(e){const n=e.listeners.indexOf(i);-1!=n&&e.listeners.splice(n,1),0==e.listeners.length&&(this.Ng.unobserve(t),delete this.yEt[s])}}}getElementVisibility(t){if(0==this.getRootVisibility())return 0;const i=se(t),s=this.yEt[i];return s&&s.isVisible&&s.intersectionRatio||0}getElementIntersectionRect(t){if(this.getElementVisibility(t)<=0)return null;const i=se(t),s=this.yEt[i];return s?s.intersectionRect:null}wEt(){if(!this.Ng){const{win:t}=this.ampdoc;this.Ng=new t.IntersectionObserver(this.OEt.bind(this),{threshold:te})}return this.Ng}OEt(t){t.forEach((t=>{let i=t.intersectionRect;i=Ws(Number(i.left),Number(i.top),Number(i.width),Number(i.height));let{boundingClientRect:s}=t;s=s&&Ws(Number(s.left),Number(s.top),Number(s.width),Number(s.height)),this.VEt(t.target,t.intersectionRatio,i,s)}))}VEt(t,i,s,e){i=Math.min(Math.max(i,0),1);const n=se(t),r=this.yEt[n];let o=!0;if((e.width<1||e.height<1)&&(o=!1),r){r.isVisible=o,r.intersectionRatio=i,r.intersectionRect=s,r.boundingClientRect=e;for(let t=0;t<r.listeners.length;t++)r.listeners[t](r.isVisible?i:0)}}},oe=class extends ne{constructor(t,i){super(t,t.ampdoc),this.embed=i,this.SEt=this.parent.isBackgrounded(),this.unsubscribe(this.parent.observe(i.host,this.setRootVisibility.bind(this)))}getStartTime(){return this.embed.getStartTime()}isBackgrounded(){return this.parent.isBackgrounded()}isBackgroundedAtStart(){return this.SEt}getRootMinOpacity(){return Ys(this.embed.iframe)}getRootLayoutBox(){const t=this.embed.iframe;return _t(this.ampdoc).getLayoutRect(t)}observe(t,i){return this.parent.observe(t,i)}getElementVisibility(t){return 0==this.getRootVisibility()?0:this.parent.getElementVisibility(t)}getElementIntersectionRect(t){return 0==this.getRootVisibility()?null:this.parent.getElementIntersectionRect(t)}},he=["AMP-AD","AMP-ANALYTICS","AMP-PIXEL","AMP-AD-EXIT"];var ue=/^vars(.+)/,ce=class{constructor(t){this.ampdoc=t,this.lTt=l(),this.NEt=null,this.CEt=null}dispose(){for(const t in this.lTt)this.lTt[t].dispose(),delete this.lTt[t];this.NEt&&this.NEt.dispose(),this.CEt&&this.CEt.dispose()}getType(){}getRoot(){}getRootElement(){const t=this.getRoot();return t.host||t.documentElement||t.body||t}getHostElement(){}signals(){}contains(t){return this.getRoot().contains(t)}getElementById(t){}getTrackerForAllowlist(t,i){const s=i[t];return s?this.getTracker(t,s):null}getTracker(t,i){let s=this.lTt[t];return s||(s=new i(this),this.lTt[t]=s),s}getTrackerOptional(t){return this.lTt[t]||null}getElement(t,i,s=null){return":root"==i?(e=()=>this.getRootElement(),new Promise((t=>{t(e())}))):":host"==i?new Promise((t=>{t(H().assertElement(this.getHostElement(),`Element "${i}" not found`))})):this.ampdoc.whenReady().then((()=>{let e,n=null;try{e="scope"==s?function(t,i){return t.querySelector(T(i,":scope"))}(t,i):"closest"==s?E(t,i):this.getRoot().querySelector(i)}catch(t){$(!1,`Invalid query selector ${i}`)}return e&&this.contains(e)&&(n=e),H().assertElement(n,`Element "${i}" not found`)}));var e}kEt(t,i=!0){return this.ampdoc.whenReady().then((()=>{let s=[];for(let e=0;e<t.length;e++){let n,r=[];const o=t[e];try{n=this.getRoot().querySelectorAll(o)}catch(t){$(!1,`Invalid query selector ${o}`)}for(let t=0;t<n.length;t++)this.contains(n[t])&&r.push(n[t]);r=i?this.LEt(r,o):r,$(r.length,`Element "${o}" not found`),s=s.concat(r)}return s.filter(((t,i)=>s.indexOf(t)===i))}))}LEt(t,i){const s=[];for(let i=0;i<t.length;i++)Object.keys(I(t[i],void 0,ue)).length&&s.push(t[i]);return s}getAmpElement(t,i,s){return this.getElement(t,i,s).then((t=>(this.DEt([t],i),t)))}getElements(t,i,s,e=!0){return n(i)?($(!s,"Cannot have selectionMethod %s defined with an array selector.",s),this.kEt(i,e)):this.getElement(t,i,s).then((t=>[t]))}DEt(t,i){for(let s=0;s<t.length;s++)$(t[s].classList.contains("i-amphtml-element"),'Element "%s" is required to be an AMP element',i)}createSelectiveListener(t,i,s,e=null){return n=>{if(":host"==s)return;const r=this.getRootElement(),o="*"==s,h=":root"==s;let{target:u}=n;for(;u&&this.contains(u)&&("scope"!=e||h||i.contains(u));)if("closest"!=e||u.contains(i)){if(o||h&&u==r||fe(u,s)){t(u,n);break}u=u.parentElement}else u=u.parentElement}}whenIniLoaded(){}getVisibilityManager(){return this.NEt||(this.NEt=ee(this.getRoot())),this.NEt}getScrollManager(){return this.CEt||(this.CEt=new class{constructor(t){this.Uu=_t(t.ampdoc),this.oc=G(t.ampdoc,"mutator"),this.xEt=null,this.Rr=new as,this.pu=t.getRootElement(),this.UEt=null}dispose(){this.Rr.removeAll(),this.HEt()}removeScrollHandler(t){this.Rr.remove(t),this.Rr.getHandlerCount()<=0&&this.HEt()}addScrollHandler(t){const i=this.Uu.getSize();return this.jEt().then((s=>{const{height:e,left:n,top:r,width:o}=s,h={top:this.Uu.getScrollTop()-r,left:this.Uu.getScrollLeft()-n,width:i.width,height:i.height,scrollHeight:e,scrollWidth:o,initialSize:{scrollHeight:e,scrollWidth:o}};t(h)})),0===this.Rr.getHandlerCount()&&this.FEt(),this.Rr.add(t)}R$(t){return Promise.all([this.jEt(),this.qEt()]).then((i=>{const{height:s,width:e}=i[0],{height:n,left:r,top:o,width:h}=i[1],u={top:t.top-o,left:t.left-r,width:t.width,height:t.height,scrollWidth:h,scrollHeight:n,initialSize:{scrollHeight:s,scrollWidth:e}};this.Rr.fire(u)}))}HEt(){this.xEt&&(this.xEt(),this.xEt=null)}FEt(){this.xEt=this.Uu.onChanged(this.R$.bind(this))}jEt(){return q(this.UEt||this.qEt())}qEt(){const t=this.oc.measureElement((()=>this.Uu.getLayoutRect(this.pu)));return this.UEt=this.UEt||t,t}}(this)),this.CEt}},ae=class extends ce{constructor(t){super(t)}getType(){return"ampdoc"}getRoot(){return this.ampdoc.getRootNode()}getHostElement(){return null}signals(){return this.ampdoc.signals()}getElementById(t){return this.ampdoc.getElementById(t)}whenIniLoaded(){const t=_t(this.ampdoc);let i;if("inabox"==C(this.ampdoc.win).runtime)i=t.getLayoutRect(this.getRootElement());else{const s=t.getSize();i=Ws(0,0,s.width,s.height)}return s=this.ampdoc,this.ampdoc.win,function(t,i){const s=ot(t);return s.signals().whenSignal("ready-scan").then((()=>{const t=(t=>G(t,"resources"))(s).get().filter((t=>!(i&&!t.prerenderAllowed()||he.includes(t.element.tagName)))).map((t=>t.element));return 0===t.length?Promise.resolve([]):new Promise((i=>{const{win:e}=s,n=new e.IntersectionObserver((t=>{n.disconnect();const s=[];for(let i=0;i<t.length;i++){const{isIntersecting:e,target:n}=t[i];e&&s.push(n)}i(s)}),{root:v(e)?e.document:null,threshold:.01});for(let i=0;i<Math.min(t.length,100);i++)n.observe(t[i])})).then((t=>Promise.all(t.map((t=>t.whenLoaded())))))}))}(s,e);var s,e}},le=class extends ce{constructor(t,i){super(t),this.embed=i}getType(){return"embed"}getRoot(){return this.embed.win.document}getHostElement(){return this.embed.iframe}signals(){return this.embed.signals()}getElementById(t){return this.embed.win.document.getElementById(t)}whenIniLoaded(){return this.embed.whenIniLoaded()}};function fe(t,i){try{return function(t,i){return t.matches(i)}(t,i)}catch(t){return H().error("amp-analytics/analytics-root","Bad query selector.",i,t),!1}}var de="__AMP_AN_ROOT";function _e(t,i){return me(t)===me(i)}function me(t){return t.replace(/^(?:www\.|m\.|amp\.)+/,"")}function Ae(t,i){const s=i.replace(/[-\/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");return new RegExp("^"+s+"$").test(t)}var Pe={"AMPDOC_HOST":!0,"AMPDOC_HOSTNAME":!0,"AMPDOC_URL":!0,"AMP_VERSION":!0,"AVAILABLE_SCREEN_HEIGHT":!0,"AVAILABLE_SCREEN_WIDTH":!0,"BACKGROUND_STATE":!0,"BROWSER_LANGUAGE":!0,"CANONICAL_HOST":!0,"CANONICAL_HOSTNAME":!0,"CANONICAL_PATH":!0,"CANONICAL_URL":!0,"DOCUMENT_CHARSET":!0,"FIRST_CONTENTFUL_PAINT":!0,"FIRST_VIEWPORT_READY":!0,"MAKE_BODY_VISIBLE":!0,"RANDOM":!0,"SCREEN_COLOR_DEPTH":!0,"SCREEN_HEIGHT":!0,"SCREEN_WIDTH":!0,"SOURCE_HOST":!0,"SOURCE_HOSTNAME":!0,"SOURCE_PATH":!0,"SOURCE_URL":!0,"TIMESTAMP":!0,"TIMEZONE":!0,"TIMEZONE_CODE":!0,"USER_AGENT":!0,"VIEWPORT_HEIGHT":!0,"VIEWPORT_WIDTH":!0},pe="${extraUrlParams}",Te={"default":new class{generateRequest(t,i,s=!1){return s?{url:t.replace(pe,""),payload:JSON.stringify(i.extraUrlParams)}:{url:Ee(t,[i])}}generateBatchRequest(t,i,s=!1){return s?{url:t.replace(pe,""),payload:JSON.stringify(i.map((t=>t.extraUrlParams)))}:{url:Ee(t,i)}}}};function Ee(t,i){const s=i.map((t=>$t(t.extraUrlParams))).filter(Boolean).join("&");let e;return e=t.indexOf(pe)>=0?t.replace(pe,s):Ft(t,s),e}var ge=class{constructor(t,i,s,e,n){this.yf=t,this.Ni=t.getAmpDoc(),this.win=this.Ni.win,this.$Et=i.origin,this.baseUrl=q(i.baseUrl),this.BEt=i.batchInterval,this.GEt=Number(i.reportWindow)||null,this.WEt=null,this.yT=Wi(t),this.vj=lt(t),this.wv=dt(t),this.zEt=null,this.YEt=null,this.KEt=[],this.XEt=s,this.aI=e,this.Yn=n?Pe:void 0,this.JEt=null,this.ZEt=null,this.QEt=!0,this.tIt=null,this.$et=0,this.zn=Date.now(),this.iIt(),this.sIt()}send(t,i,s){const e=!0===i.important;if(!this.QEt&&!e)return;this.$et++,this.tIt=i;const n=this.yT.getMacros(this.yf);var o,h,u;if(n.RESOURCE_TIMING=(o=this.yf,h=i.resourceTimingSpec,u=this.zn,h&&Date.now()<u+6e4?function(t,i){const{win:s}=t.getAmpDoc();if(i.done||!s.performance||!s.performance.now||!s.performance.getEntriesByType||!a((e=i).resources)||!(e.encoding&&e.encoding.entry&&e.encoding.delim)||e.encoding.base<2||e.encoding.base>36||null!=e.responseAfter&&"number"!=typeof e.responseAfter)return i.done=!0,Promise.resolve("");var e;let n=function(t){return t.performance.getEntriesByType("resource")}(s);n.length>=150&&(i.done=!0);const o=i.responseAfter||0;return i.responseAfter=Math.max(o,s.performance.now()),n=n.filter((t=>t.startTime+t.duration>=o)),n.length?(h=()=>function(t,i,s){const e=i.resources,n=i.encoding,o=Wi(s),h=(t,i=0)=>Math.round(t-i).toString(n.base||10),u=function(t,i){const s=function(t){const i={};for(const s in t){const e=t[s].host||"",n=t[s].path||"",r=t[s].query||"",o={name:s,pathPattern:new RegExp(n),queryPattern:new RegExp(r)};i[e]?i[e].resources.push(o):i[e]={hostPattern:new RegExp(e),resources:[o]}}const s=[];for(const t in i)s.push(i[t]);return s}(i),e=[];return t.forEach((t=>{const i=function(t,i){const s=t.name;for(let t=0;t<i.length;++t){const{hostPattern:e,resources:n}=i[t];if(!e.test(s.host))continue;const o=r(n,(t=>t.pathPattern.test(s.pathname)&&t.queryPattern.test(s.search)));if(-1!=o)return n[o].name}return null}(t,s);i&&e.push({entry:t,name:i})})),e}(t,e).map((t=>{const{entry:i,name:s}=t;return function(t,i,s){const e={"key":i,"startTime":s(t.startTime),"redirectTime":s(t.redirectEnd,t.redirectStart),"domainLookupTime":s(t.domainLookupEnd,t.domainLookupStart),"tcpConnectTime":s(t.connectEnd,t.connectStart),"serverResponseTime":s(t.responseStart,t.requestStart),"networkTransferTime":s(t.responseEnd,t.responseStart),"transferSize":s(t.transferSize||0),"encodedBodySize":s(t.encodedBodySize||0),"decodedBodySize":s(t.decodedBodySize||0),"duration":s(t.duration),"initiatorType":t.initiatorType};return new Ui(e,1)}(i,s,h)})).map((t=>o.expandTemplate(n.entry,t,s)));return Promise.all(u).then((t=>t.join(n.delim)))}(n,i,t),new Promise((t=>{setTimeout((()=>t(h())))}))):Promise.resolve("");var h}(o,h):Promise.resolve("")),this.zEt||(s.freezeVar("extraUrlParams"),this.zEt=this.eIt(this.baseUrl,s,n)),!this.YEt&&this.$Et){const t=new Ui(s.vars,s.iterations,!0);this.YEt=this.eIt(this.$Et,t,n)}const c=St(St({},t),i.extraUrlParams),l=this.win.Date.now(),f=Ie(this.yT,this.vj,c,s,n,this.yf,this.Yn).then((t=>({"trigger":i.on,"timestamp":l,"extraUrlParams":t})));this.KEt.push(f),this.Ee(e||!this.BEt)}dispose(){this.Ws(),this.JEt&&(this.win.clearTimeout(this.JEt),this.JEt=null),this.ZEt&&(this.win.clearTimeout(this.ZEt),this.ZEt=null)}eIt(t,i,s){return this.yT.expandTemplate(t,i,this.yf,s,this.Yn).then((t=>this.vj.expandUrlAsync(t,s,this.Yn).catch((i=>$(!1,`Could not expand URL "${t}": ${i.message}`)))))}Ee(t){0!=this.$et&&t&&this.nIt()}nIt(){const{zEt:t,KEt:i,YEt:s}=this,e=this.tIt;this.Ws(),(s||t).then((t=>{this.XEt.url(this.Ni,t,!0)})),Promise.all([t,Promise.all(i),s]).then((t=>{const i=this.rIt(t[0],t[2]),s=t[1];0!==s.length&&(e.iframePing?($(e.on==Ss,"iframePing is only available on page view requests."),this.aI.sendRequestUsingIframe(i,s[0])):this.aI.sendRequest(i,s,!!this.BEt))}))}Ws(){this.$et=0,this.zEt=null,this.KEt=[],this.tIt=null}sIt(){if(this.BEt){this.BEt=n(this.BEt)?this.BEt:[this.BEt];for(let t=0;t<this.BEt.length;t++){let i=this.BEt[t];$(_(i),"Invalid batchInterval value: %s",this.BEt),i=1e3*Number(i),$(i>=200,"Invalid batchInterval value: %s, interval value must be greater than %s ms.",this.BEt,200),this.BEt[t]=i}this.WEt=0,this.oIt()}}iIt(){this.GEt&&(this.ZEt=this.win.setTimeout((()=>{this.Ee(!0),this.QEt=!1,this.JEt&&(this.win.clearTimeout(this.JEt),this.JEt=null)}),1e3*this.GEt))}oIt(){q(null!=this.WEt);const t=this.WEt<this.BEt.length?this.BEt[this.WEt++]:this.BEt[this.BEt.length-1];this.JEt=this.win.setTimeout((()=>{this.Ee(!0),this.oIt()}),t)}rIt(t,i){return i?this.wv.parse(i).origin+t:t}};function Ie(t,i,s,e,r,o,h){const u={},c=[],l=new Ui(e.vars,e.iterations,!0),f=(s,e,u)=>{const d=s[e];if("string"==typeof d){u[e]=void 0;const s=t.expandTemplate(d,l,o).then((t=>i.expandStringAsync(t,r,h))).then((t=>{u[e]=t}));c.push(s)}else if(n(d)){u[e]=[];for(let t=0;t<d.length;t++)f(d,t,u[e])}else if(a(d)&&null!==d){u[e]={};const t=Object.keys(d);for(let i=0;i<t.length;i++)f(d,t[i],u[e])}else u[e]=d},d=Object.keys(s);for(let t=0;t<d.length;t++)f(s,d[t],u);return Promise.all(c).then((()=>u))}var ve=class{constructor(t,i){this.sut=i,this.Rst=!1,this.hIt=[],this.bgt=new class{constructor(t,i,s,e){this.gv=t,this.Dg=s,this.Fg=[],this.Wg=function(t,i,s,e,n,r){q(t.src),q(!t.parentNode),q(s);const o=t.ownerDocument.defaultView;!function(t){t.listeningFors||t.addEventListener("message",(function(i){if(!pt(i))return;const s=function(t){return"string"==typeof t&&(t="{"==t.charAt(0)?P(t,(t=>{}))||null:ti(t)?function(t){if(!ti(t))return null;const i=t.indexOf("{");return m(-1!=i),P(t.substr(i),(i=>{S(new Error(`MESSAGING: Failed to parse message: ${t}\n${i.message}`))}))}(t):null),t}(pt(i));if(!s||!s.sentinel)return;const e=function(t,i,s,e){const n=hi(t,i);if(!n)return n;let r;for(let t=0;t<n.length;t++){const i=n[t],{contentWindow:s}=i.frame;if(s){if(e==s||ui(s,e)){r=i;break}}else setTimeout(ci,0,n)}return r?r.events:null}(t,s.sentinel,i.origin,i.source);if(!e)return;let n=e[s.type];if(n){n=n.slice();for(let t=0;t<n.length;t++)(0,n[t])(s,i.source,i.origin,i)}}))}(o);const h=function(t,i,s){const e=hi(t,ai(i,s),!0);let n;for(let t=0;t<e.length;t++){const s=e[t];if(s.frame===i){n=s;break}}return n||(n={frame:i,events:Object.create(null)},e.push(n)),n.events}(o,t,e),u=jt(t.src).origin;let c,a=h[i]||(h[i]=[]),l=function(i,e,o,h){if("amp"==i.sentinel){if(e!=t.contentWindow)return;const i="null"==o&&r;if(u!=o&&!i)return}(n||e==t.contentWindow)&&(i.sentinel!=oi?s(i,e,o,h):c())};return a.push(l),c=function(){if(l){const t=a.indexOf(l);t>-1&&a.splice(t,1),l=null,a=null,s=null}}}(this.gv,i,((t,i,s)=>{this.Fg.some((t=>t.win==i))||this.Fg.push({win:i,origin:s}),e(t,i,s)}),this.Dg,this.Dg)}send(t,i){(function(t,i){const s=[];let e=0;for(let i=0;i<t.length;i++){const n=t[i];n.win.parent?(e<i&&(t[e]=n),e++):s.push(n)}e<t.length&&(t.length=e)})(this.Fg),function(t,i,s,e,n){if(!t.contentWindow)return;e.type=s,e.sentinel=ai(t,n);let r=e;n&&(r="amp-"+JSON.stringify(e));for(let t=0;t<i.length;t++){const s=i[t];s.win.postMessage(r,s.origin)}}(this.gv,this.Fg,t,i,this.Dg)}destroy(){this.Wg(),this.Fg.length=0}}(this.sut,"send-iframe-transport-events",!0,(()=>{this.setIsReady()}))}isReady(){return this.Rst}setIsReady(){this.Rst=!0,this.uIt()}queueSize(){return this.hIt.length}enqueue(t){q(t&&t.creativeId&&t.message),this.hIt.push(t),this.queueSize()>=100&&this.hIt.shift(),this.uIt()}uIt(){this.isReady()&&this.queueSize()&&(this.bgt.send("iframe-transport-events",{events:this.hIt}),this.hIt=[])}},Re=(()=>self.AMP.config.urls)(),Me=class t{constructor(t,i,s,e){this.cIt=t,this.DC=i,this.aIt=e,q(s&&s.iframe),this.lIt=s.iframe,this.fIt=0,this.processCrossDomainIframe()}detach(){t.markCrossDomainIframeAsDone(this.cIt.document,this.DC)}processCrossDomainIframe(){let i;t.hasCrossDomainIframe(this.DC)?(i=t.getFrameData(this.DC),++i.usageCount):(i=this.createCrossDomainIframe(),this.cIt.document.body.appendChild(i.frame),this.gm()),q(i)}createCrossDomainIframe(){const i=t.dIt(),s=JSON.stringify({scriptSrc:(this.cIt,Re.thirdParty+"/2405022220000/iframe-transport-client-v0.js"),sentinel:i,type:this.DC}),e=g(this.cIt.document,"iframe",{sandbox:"allow-scripts allow-same-origin",name:s,"data-amp-3p-sentinel":i});e.sentinel=i,ri(e,!1),e.src=this.lIt;const n={frame:e,usageCount:1,queue:new ve(this.cIt,e)};return t._It[this.DC]=n,n}gm(){var i;(i=this.cIt).PerformanceObserver&&i.TaskAttributionTiming&&"containerName"in i.TaskAttributionTiming.prototype&&(t.mIt[this.DC]=new this.cIt.PerformanceObserver((t=>{t&&t.getEntries().forEach((t=>{t&&"longtask"==t.entryType&&"cross-origin-descendant"==t.name&&t.attribution&&t.attribution.forEach((t=>{this.lIt==t.containerSrc&&++this.fIt%5==0&&H().error("amp-analytics/iframe-transport",`Long Task: Vendor: "${this.DC}"`)}))}))})),t.mIt[this.DC].observe({entryTypes:["longtask"]}))}static markCrossDomainIframeAsDone(i,s){const e=t.getFrameData(s);q(e&&e.frame&&e.usageCount),--e.usageCount||(i.body.removeChild(e.frame),delete t._It[s],t.mIt[s]&&(t.mIt[s].disconnect(),t.mIt[s]=null))}static hasCrossDomainIframe(i){return f(t._It,i)}static dIt(){return String(++t.AIt)}sendRequest(i){const s=t.getFrameData(this.DC);q(s),q(s.queue),s.queue.enqueue({creativeId:this.aIt,message:i})}static getFrameData(i){return t._It[i]}static resetCrossDomainIframes(){t._It={}}getCreativeId(){return this.aIt}getType(){return this.DC}};function be(t,i,s=!1,e,n){const r=new(_i.getImage(t));s&&(r.referrerPolicy="no-referrer");let o=0;var h;return null!=e&&((null===(h=t.document.featurePolicy)||void 0===h?void 0:h.allowedFeatures().includes("attribution-reporting"))?(o=6,e=Se(t,o,n)(e),r.attributionSrc=e):o=5),i=Se(t,o,n)(i),r.src=i,r}function Se(t,i,s){const e={"ATTRIBUTION_REPORTING_STATUS":()=>i},n=lt(s||t.document),r={"ATTRIBUTION_REPORTING_STATUS":!0};return t=>n.expandUrlSync(t,e,r)}Me._It={},Me.AIt=0,Me.mIt={};var ye,we="amp-analytics/transport",Oe="amp-analytics",Ve=[Ss,Es,gs,Is],Ne=class extends t.BaseElement{constructor(t){super(t),this.PIt=s(),this.pIt=null,this.TIt=!1,this.iG={},this.CM={},this.EIt=null,this.gIt=null,this.yT=null,this.IIt=ht(this.win),this.vIt=null,this.aI=null,this.DC=this.element.getAttribute("type"),this.RIt="inabox"==C(this.win).runtime,this.MIt=null,this.bIt=null,this.SIt=null}getLayoutPriority(){return this.RIt?0:1}isAlwaysFixed(){return!fi(this.element)}isLayoutSupported(t){return!0}buildCallback(){var t;this.TIt=this.element.hasAttribute("sandbox"),this.element.setAttribute("aria-hidden","true"),this.pIt=this.element.getAttribute("data-consent-notification-id"),null!=this.pIt&&(this.PIt=(t=this.element,function(t,i,s,e){return nt(t,"userNotificationManager",s,void 0).then((t=>function(t,i,s){return $(t,"Service %s was requested to be provided through %s, but %s is not loaded in the current page. To fix this problem load the JavaScript file for %s in this page.","userNotificationManager",s,s,s)}(t,0,s)))}(t,0,"amp-user-notification")).then((t=>t.get(this.pIt)))),"immediate"==this.element.getAttribute("trigger")&&this.yIt()}layoutCallback(){return this.yIt()}detachedCallback(){this.gIt&&(this.gIt.dispose(),this.gIt=null),this.MIt&&(this.MIt.dispose(),this.MIt=null);for(const t in this.iG)this.iG[t].dispose(),delete this.iG[t]}resumeCallback(){this.vIt&&this.vIt.then((()=>{this.aI.maybeInitIframeTransport(this.element)}))}unlayoutCallback(){return!this.getAmpDoc().isVisible()&&(this.vIt&&this.vIt.then((()=>{this.aI.deleteIframeTransport()})),super.unlayoutCallback())}yIt(){if(this.vIt)return this.vIt;const t=this.getAmpDoc();return this.vIt=t.whenFirstVisible().then((()=>at(this.win).promise(1))).then((()=>this.PIt)).then((()=>{return Promise.all([(i=t,z(i,"amp-analytics-instrumentation")),zi(t)]);var i})).then((t=>{this.EIt=t[0],this.yT=t[1];const i=new e,n=()=>{const t=new class{constructor(t){this.yf=t,this.i=null,this.wIt=wt||{},this.mAt={},this.CM={},this.OIt={},this.TIt=!1,this.yT=Wi(t)}loadConfig(){return this.i=this.yf.ownerDocument.defaultView,this.TIt=this.yf.hasAttribute("sandbox"),Promise.all([this.VIt(),this.NIt()]).then(this.CIt.bind(this)).then(this.kIt.bind(this)).then((()=>this.CM))}LIt(t){const i=(this.i.location,D.cdn),s="bg"===t&&null!==(e=self.AMP_CONFIG)&&void 0!==e&&e.canary?".canary":"";var e;return`${i}/rtv/${C().rtvVersion}/v0/analytics-vendors/${t}${s}.json`}NIt(){const t=this.yf.getAttribute("type");if(!t)return s();const i=this.LIt(t),e=this.ts();return mt(this.i).fetchJson(i,{ampCors:!1}).then((t=>t.json())).then((t=>{this.mAt=t||{}}),(t=>{H().error(e,"Error loading vendor config: ",i,t)}))}VIt(){let t=this.yf.getAttribute("config");if(!t||this.TIt)return s();Bt(t,this.yf);const i=this.ts(),e={};return this.yf.hasAttribute("data-credentials")&&(e.credentials=this.yf.getAttribute("data-credentials")),lt(this.yf).expandUrlAsync(t,this.yT.getMacros(this.yf)).then((i=>(t=i,mt(this.i).fetchJson(t,e)))).then((t=>t.json())).then((t=>{this.OIt=t}),(s=>{H().error(i,"Error loading remote config: ",t,s)}))}CIt(){const t=this.DIt().url,i={},e=this.Gnt();return this.xIt(e),Ji(e,i),Ji(this.OIt,i),!t||this.TIt?(this.CM=this.UIt(i),s()):this.HIt(i,t)}HIt(t,i){Bt(i,this.yf);const s=this.ts();return this.jIt(t).then((()=>{const e={method:"POST",body:t};return this.yf.hasAttribute("data-credentials")&&(e.credentials=this.yf.getAttribute("data-credentials")),lt(this.yf).expandUrlAsync(i).then((t=>mt(this.i).fetchJson(t,e))).then((t=>t.json())).then((t=>{this.CM=this.UIt(t)}),(t=>{H().error(s,"Error rewriting configuration: ",i,t)}))}))}kIt(){this.CM.warningMessage&&(this.ts(),this.yf.getAttribute("type"),this.yf.getAttribute("config"),delete this.CM.warningMessage)}jIt(t){const i=t.configRewriter,e=i&&i.varGroups,n=this.DIt().varGroups;if(!e&&!n)return s();if(e&&!n)return this.ts(),s();t.configRewriter=t.configRewriter||{};const r=t.configRewriter;r.vars={};const o=[],h=e||{};return d(h,n),Object.keys(h).forEach((t=>{const i=h[t];if(!i.enabled)return;const s=this.shallowExpandObject(this.yf,i).then((t=>{delete t.enabled,Object.assign(r.vars,t)}));o.push(s)})),Promise.all(o).then((()=>{if(!Object.keys(r.vars).length)return delete t.configRewriter;e&&delete r.varGroups}))}UIt(t){const i={"vars":{"requestCount":0}};return Ji(Zi(this.wIt),i),Ji(Zi(this.mAt),i,!0),Ji(Zi(t),i,!0),i}DIt(){return this.mAt.configRewriter||{}}Gnt(){if(this.yf.CONFIG)return this.yf.CONFIG;let t={};const i=this.ts();try{const{children:s}=this.yf;1==s.length?t=function(t){const i=(e=t,m(/^[\w-]+$/.test("script")),"> script",e.querySelectorAll(T("> script",":scope"))),{length:s}=i;var e;if(1!==s)throw new Error(`Found ${s} <script> children. Expected 1.`);const n=i[0];if(!function(t){var i;return"SCRIPT"==t.tagName&&"APPLICATION/JSON"==(null===(i=t.getAttribute("type"))||void 0===i?void 0:i.toUpperCase())}(n))throw new Error('<script> child must have type="application/json"');try{var r;return A(null!==(r=n.textContent)&&void 0!==r?r:"")}catch(t){throw new Error("Failed to parse <script> contents. Is it valid JSON?")}}(this.yf):s.length>1&&H().error(i,"The tag should contain only one <script> child.")}catch(t){H().error(i,t.message)}return t}xIt(t){if(this.yf.getAttribute("type")&&(t.transport||this.OIt.transport)){const t=this.ts();H().error(t,"Inline or remote config should not overwrite vendor transport settings")}t.transport&&t.transport.iframe&&(H().error(Xi,"Inline configs are not allowed to specify transport iframe"),t.transport.iframe=void 0),this.OIt.transport&&this.OIt.transport.iframe&&(H().error(Xi,"Remote configs are not allowed to specify transport iframe"),this.OIt.transport.iframe=void 0)}ts(){return"AmpAnalytics "+(this.yf.getAttribute("id")||"<unknown id>")}shallowExpandObject(t,i){const s={},e=[],n=[],r=lt(t),o=Wi(t).getMacros(t);return Object.keys(i).forEach((t=>{e.push(t);const s=r.expandStringAsync(i[t],o);n.push(s)})),Promise.all(n).then((t=>(e.forEach(((i,e)=>s[i]=t[e])),s)))}}(this.element).loadConfig();i.resolve(t)};return this.RIt?n():es(this.element,n,20),i.promise})).then((t=>(this.CM=t,new class{constructor(t,i,s){this.i=t,this.yf=i,this.vj=lt(i),this.FIt=null,this.CM=s,this.qn=Wi(i).getMacros(i)}write(){if(!this.FIt){this.FIt=new e;const t=()=>{this.FIt.resolve(this.Au())};es(this.yf,t,10)}return this.FIt.promise}Au(){if(!di(this.i,this.yf))return s();if(!f(this.CM,"cookies"))return s();if(!a(this.CM.cookies))return H().error(us,"cookies config must be an object"),s();const t=this.CM.cookies;if(!1===t.enabled)return s();const i=this.tet(t),e=Object.keys(t),n=[];for(let s=0;s<e.length;s++){const r=e[s],o=t[r],h=this.qIt(o.sameSite||o.SameSite||t.sameSite||t.SameSite);this.net(r,o)&&n.push(this.eet(r,o.value,i,h))}return Promise.all(n)}tet(t){if(!f(t,"cookieMaxAge"))return Qi;const i=Number(t.cookieMaxAge);return i||0===i?1e3*i:(H().error(us,"invalid cookieMaxAge %s, falling back to default value (1 year)",t.cookieMaxAge),Qi)}net(t,i){return!(cs[t]||(a(i)?!f(i,"value")&&(H().error(us,"value is required in the cookieValue object"),1):(H().error(us,"cookieValue must be configured in an object"),1)))}eet(t,i,s,e){return this.vj.expandStringAsync(i,this.qn).then((i=>{if(i){const n=Date.now()+s,r=e===Xt;!function(t,i,s,e,n={}){let r;!function(t,i,s){if(i.allowOnProxyOrigin)return void $(!i.highestAvailableDomain,"Could not support highestAvailable Domain on proxy origin, specify domain explicitly");$(!Gt(t.location.href),`Should never attempt to set cookie on proxy origin: ${s}`);const e=jt(t.location.href).hostname.toLowerCase(),n=jt(Yt.cdn).hostname.toLowerCase();$(!(e==n||o(e,"."+n)),"Should never attempt to set cookie on proxy origin. (in depth check): "+s)}(t,n,i),n.domain?r=n.domain:n.highestAvailableDomain&&(r=Zt(t)),Qt(t,i,s,e,r,n.sameSite,n.secure)}(this.i,t,i,n,{highestAvailableDomain:!0,sameSite:e,secure:r})}})).catch((t=>{H().error(us,"Error expanding cookie string",t)}))}qIt(t){switch(t){case"Strict":return"Strict";case"Lax":return"Lax";case"None":return Xt;default:return}}}(this.win,this.element,this.CM).write()))).then((()=>{this.aI=new class t{constructor(t,i={}){this.Ni=t,this.i=t.win,this.U=i,this.ve=this.U.referrerPolicy,"no-referrer"===this.ve&&(this.U.beacon=!1,this.U.xhrpost=!1),this.$It=!!this.U.useBody,this.BIt=null,this.RIt="inabox"==C(this.i).runtime,this.GIt=this.U.attributionsrc}sendRequest(i,s,e){if(!i||0===s.length)return;const n=this.WIt(),r=function(t){const r={};return t=>{const o=String(t);return void 0===r[o]&&(r[o]=function(t){const r=e?n.generateBatchRequest(i,s,t):n.generateRequest(i,s[0],t);return r.url.startsWith("amp-script:")||(Bt(r.url,"amp-analytics request"),function(t){$(!("__amp_source_origin"in O(jt(t).search)),"Source origin is not allowed in %s",t)}(r.url)),r}(t)),r[o]}}();if(this.U.iframe)return this.BIt?void this.BIt.sendRequest(r(!1).url):void F().error(we,"iframe transport was inadvertently deleted");if(this.U["amp-script"])return void t.forwardRequestToAmpScript(this.Ni,{url:i,payload:r(!0).payload});if(this.U.beacon&&t.sendRequestUsingBeacon(this.i,r(this.$It)))return;if(this.U.xhrpost&&t.sendRequestUsingXhr(this.i,r(this.$It)))return;const o=this.U.image;if(o){const i="object"==typeof o&&o.suppressWarnings;t.sendRequestUsingImage(this.i,r(!1),i,this.ve,this.GIt,this.Ni)}}maybeInitIframeTransport(t){if(!this.U.iframe||this.BIt)return;const i=K(p(t)),s=t.getAttribute("type"),e=this.RIt?"1":H().assertString(function(t,i){try{const s=X(t,i).parentElement;if("AMP-AD"==s.nodeName)return String(s.getResourceId())}catch(t){}return null}(t,i),"No friendly amp-ad ancestor element was found for amp-analytics tag with iframe transport.");this.BIt=new Me(i,s,this.U,e)}deleteIframeTransport(){this.BIt&&(this.BIt.detach(),this.BIt=null)}sendRequestUsingIframe(t,i){const s=Ee(t,[i]);if(!s)return void H().error(we,"Request not sent. Contents empty.");Bt(s,"amp-analytics request"),$(jt(s).origin!=jt(this.i.location.href).origin,"Origin of iframe request must not be equal to the document origin. See https://github.com/ampproject/amphtml/blob/main/docs/spec/amp-iframe-origin-policy.md for details.");const e=this.i.document.createElement("iframe");ri(e,!1),e.onload=e.onerror=()=>{at(this.i).delay((()=>{var t,i;null===(i=(t=e).parentElement)||void 0===i||i.removeChild(t)}),5e3)},e.setAttribute("amp-analytics",""),e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.src=s,this.i.document.body.appendChild(e)}WIt(){return Te.default}static sendRequestUsingImage(t,i,s,e,n,r){t&&function(t){let i,s;if(function(t){return!!(t.complete||"complete"==t.readyState||Et(t)&&t.readyState>0||t.document&&"complete"==t.document.readyState)}(t))return Promise.resolve(t);const e=Et(t);return e&&t.__AMP_MEDIA_LOAD_FAILURE_SRC===t.currentSrc?Promise.reject(t):new Promise(((n,r)=>{if(i=e?Tt(t,"loadedmetadata",n,{capture:!0}):Tt(t,"load",n),!t.tagName)return;let o=t;if(e&&!t.hasAttribute("src")&&(o=function(t,i){for(let s=t.lastElementChild;s;s=s.previousElementSibling)if(i(s))return s;return null}(t,(t=>"SOURCE"===t.tagName)),!o))return r(new Error("Media has no source."));s=Tt(o,"error",r)})).then((()=>(s&&s(),t)),(()=>{i&&i(),function(t){Et(t)&&(t.__AMP_MEDIA_LOAD_FAILURE_SRC=t.currentSrc||!0);let i=t;throw i&&i.src&&(i=i.src),H().createError("Failed to load:",i)}(t)}))}(function(t,i,s,e,n){return s&&"no-referrer"!==s&&H().error("pixel","Unsupported referrerPolicy: %s",s),"no-referrer"===s?function(t,i,s,e){if("referrerPolicy"in Image.prototype)return be(t,i,!0,s,e);{const s=g(t.document,"iframe",{"src":"about:blank","style":"display:none"});return s.onload=()=>{be(s.contentWindow,i,void 0,void 0,e)},t.document.body.appendChild(s),s}}(t,i,e,n):be(t,i,!1,e,n)}(t,i.url,e,n,r)).then((()=>{})).catch((()=>{}))}static sendRequestUsingBeacon(t,i){const s=_i.getSendBeacon(t);return!!s&&s(i.url,i.payload||"")}static sendRequestUsingXhr(t,i){const s=_i.getXMLHttpRequest(t);if(!s)return!1;const e=new s;return"withCredentials"in e&&(e.open("POST",i.url,!0),e.withCredentials=!0,e.setRequestHeader("Content-Type","text/plain"),e.onreadystatechange=()=>{e.readyState},e.send(i.payload||""),!0)}static forwardRequestToAmpScript(t,i){return(s=t,function(t,i,s){const e=W(t,i);return e?Promise.resolve(e):nt(t,i,"amp-script")}(s,"amp-script")).then((t=>{$(t,"AMP-SCRIPT is not installed"),t.fetch(i.url,JSON.parse(i.payload))}));var s}}(this.getAmpDoc(),this.CM.transport||{})})).then(this.zIt.bind(this)).then(this.YIt.bind(this)).then(this.KIt.bind(this)),this.vIt.then((()=>{this.collapse()})),this.vIt}XIt(){return!!this.RIt||(null==this.SIt&&(this.SIt=fi(this.element)),this.SIt)}zIt(){return this.CM.triggers&&Object.values(this.CM.triggers).some((t=>{var i;return null==t||null===(i=t.session)||void 0===i?void 0:i.persistEvent}))&&this.DC?Ci(this.getAmpDoc()).then((t=>{this.bIt=t})):s()}YIt(){if(this.JIt())return this.ts(),s();if(this.ZIt(),!this.CM.triggers){const t=this.ts();return this.user().warn(t,"No triggers were found in the config. No analytics data will be sent."),s()}this.QIt(this.CM.extraUrlParams,this.CM.extraUrlParamsReplaceMap),this.gIt=this.EIt.createAnalyticsGroup(this.element),this.aI.maybeInitIframeTransport(this.element);const t=[];for(const s in this.CM.triggers)if(f(this.CM.triggers,s)){const e=this.CM.triggers[s],r=this.tRt({},e,void 0,!0),o=this.ts();if(!e){this.user().error(o,"Trigger should be an object: ",s);continue}const h=e.request||e.parentPostMessage&&this.XIt();if(!e.on||!h){const t=this.XIt()?'/"parentPostMessage"':"";this.user().error(o,'"on" and "request"'+t+" attributes are required for data to be collected.");continue}if(this.TIt){const t=e.on;if(!("click"!==(i=t)&&"browser-event"!==i&&"custom"!==i&&"hidden"!==i&&"ini-load"!==i&&"render-start"!==i&&"scroll"!==i&&"story"!==i&&"timer"!==i&&"video"!==i&&"visible"!==i||Ve.includes(t))){this.user().error(o,t+" is not supported for amp-analytics in scope");continue}}this.QIt(e.extraUrlParams,this.CM.extraUrlParamsReplaceMap),t.push(this.iRt(e).then((t=>{if(t){if(this.TIt){if(!this.element.parentElement)return;return e.selector=this.element.parentElement.tagName,e.selectionMethod="closest",this.sRt(e)}return e.selector&&!n(e.selector)?this.yT.expandTemplate(e.selector,r,this.element).then((t=>(e.selector=t,this.sRt(e)))):this.sRt(e)}})))}var i;return Promise.all(t)}preload(t,i){ct(this.win).preload(this.getAmpDoc(),t,i)}sRt(t){if(!this.gIt)return s();try{return this.gIt.addTrigger(t,this.pb.bind(this,t))}catch(i){return S(this.ts(),'Failed to process trigger "'+t.on+'"',i),s()}}QIt(t,i){if(t&&i){let s=0;for(const e in i){if(++s>16){const t=this.ts();this.user().error(t,"More than 16 extraUrlParamsReplaceMap rules aren't allowed; Skipping the rest");break}for(const s in t){const n=s.replace(e,i[e]);if(s!=n){const i=t[s];delete t[s],t[n]=i}}}}}JIt(){const t=this.CM.optoutElementId;if(t&&this.win.document.getElementById(t))return!0;if(!this.CM.optout)return!1;const i=this.CM.optout.split(".");let s=this.win;for(let t=0;t<i.length;t++){if(!s)return!1;s=s[i[t]]}return s()}ZIt(){if(this.CM.requests){if(this.CM.requests){for(const t in this.CM.requests)f(this.CM.requests,t)&&(this.CM.requests[t].baseUrl||(this.user().error(Oe,"request must have a baseUrl"),delete this.CM.requests[t]));for(const t in this.CM.requests)this.CM.requests[t].baseUrl=h(this.CM.requests[t].baseUrl,(t=>{const i=this.CM.requests[t];return i&&i.baseUrl||"${"+t+"}"}),5);const t={};for(const i in this.CM.requests)if(f(this.CM.requests,i)){const s=this.CM.requests[i];t[i]=new ge(this.element,s,ct(this.win),this.aI,this.TIt)}this.iG=t}}else if(!this.XIt()){const t=this.ts();this.user().warn(t,"No request strings defined. Analytics data will not be sent from this page.")}}KIt(){this.MIt=new class{constructor(t,i,s,e){this.Ni=t,this.CM=i.linkers,this.dG=i.vars||{},this.DC=s,this.yf=e,this.eRt={},this.wv=dt(this.yf),this.mJ=z(t,"form-submit-service"),this.nRt=null,this.yT=Wi(this.Ni),this.rRt=null}init(){if(!a(this.CM))return s();this.rRt=Zt(this.Ni.win),this.CM=this.oRt(this.CM);const t=Object.keys(this.CM).map((t=>{const i=this.CM[t].ids,s=Object.keys(i),e=s.map((t=>{const s=new Ui(this.dG,void 0,!0);return this.hRt(i[t],s)}));return Promise.all(e).then((i=>{const e={};return i.forEach(((t,i)=>{t&&(e[s[i]]=t)})),this.eRt[t]=e,e}))}));if(t.length){const t=G(this.Ni,"navigation");t.registerAnchorMutator(((t,i)=>{t.href&&"click"===i.type&&(t.href=this.uRt(t.href))}),2),t.registerNavigateToMutator((t=>this.uRt(t)),2)}return this.cRt(),Promise.all(t)}dispose(){this.nRt&&this.nRt()}oRt(t){const i={},s={enabled:this.aRt()&&this.lRt()},e=Object.keys(t).filter((i=>{const e=t[i],n=a(e);return n||(s[i]=e),n})),n=_i.getLocation(this.Ni.win),r=this.wv.isProxyOrigin(n);return e.forEach((e=>{const n=St(St({},s),t[e]);!0===n.enabled&&(r||!1===n.proxyOnly)&&(n.ids?i[e]=n:H().error("amp-analytics/linker-manager",'"ids" is a required field for use of "linkers".'))})),i}hRt(t,i){const s=this.yT.getMacros(this.yf);return this.yT.expandTemplate(t,i,this.yf).then((t=>lt(this.yf).expandUrlAsync(t,s)))}aRt(){return"googleanalytics"===this.DC&&"googleanalytics"===this.Ni.getMetaByName("amp-google-client-id-api")&&this.Ni.registerSingleton(2)}lRt(){const t=B(this.Ni.win,"platform");return t.isSafari()&&t.getMajorVersion()>=12}uRt(t){const i=this.CM;for(const s in i)this.eRt[s]&&(t=this.fRt(t,s,i[s]));return t}fRt(t,i,s){const e=this.wv.parse(t);if(this.dRt(e,i,s)&&this._Rt(e)){const s=Ti("1",this.eRt[i]);if(s){const e={};return e[i]=s,function(t,i){const s=O(jt(t).search),e={},n=Object.keys(i);for(let t=0;t<n.length;t++)f(s,n[t])||(e[n[t]]=i[n[t]]);return function(t,i){return Ft(t,$t(i))}(t,e)}(t,e)}}return t}dRt(t,i,s){const e=s.destinationDomains,{hostname:n}=t,r=_i.getHostname(this.Ni.win),o=s.sameDomainEnabled;if(!Boolean(o)&&r===n)return!1;if(e&&!Array.isArray(e))return!1;if(e)return this.mRt(e,n);const{canonicalUrl:h,sourceUrl:u}=G(this.Ni,"documentInfo").get(),c=_e(this.wv.parse(h).hostname,n);if(this.rRt){const t=[this.rRt,"*"+this.rRt];return this.mRt(t,n)||c}return _e(this.wv.parse(u).hostname,n)||c}_Rt(t){return"https:"===t.protocol||"http:"===t.protocol}mRt(t,i){for(let s=0;s<t.length;s++){const e=t[s];if(e===i)return!0;if(-1!==e.indexOf("*")&&Ae(i,e))return!0}return!1}cRt(){this.nRt||this.mJ.then((t=>{this.nRt=t.beforeSubmit(this.ARt.bind(this))}))}ARt(t){const{actionXhrMutator:i,form:s}=t;for(const t in this.CM){const e=this.CM[t],n=s.getAttribute("action-xhr")||s.getAttribute("action"),r=this.wv.parse(n);this.dRt(r,t,e)&&this.PRt(s,i,t)}}PRt(t,i,s){const e=this.eRt[s];if(!e)return;const n=Ti("1",e),r=t.getAttribute("action-xhr");if(r)return i(Ft(r,qt(s,n),void 0));this.pRt(t,s,n)}pRt(t,i,s){const e={"type":"hidden","name":i,"value":s},n=g(t.ownerDocument,"input",e);t.appendChild(n)}}(this.getAmpDoc(),this.CM,this.DC,this.element);const t=()=>{this.MIt.init()};this.RIt?t():es(this.element,t,10)}pb(t,i){var s,e;null===(s=t.session)||void 0===s||!s.persistEvent||null===(e=this.bIt)||void 0===e||e.updateEvent(this.DC);const r=n(t.request)?t.request:[t.request];for(let s=0;s<r.length;s++){const e=r[s];this.TRt(e,t,i)}}TRt(t,i,s){this.element.ownerDocument.defaultView||this.ts();const e=this.iG[t],n=this.XIt()&&i.parentPostMessage;if(null!=t&&!e){const t=this.ts();if(this.user().error(t,"Ignoring request for event. Request string not found: ",i.request),!n)return}this.ERt(i,s).then((t=>{const n=this.element.ownerDocument&&this.element.ownerDocument.defaultView;t&&n&&(this.gRt(e,i,s),i.parentPostMessage&&this.XIt()&&v(this.win)&&this.IRt(i,s))}))}gRt(t,i,s){if(!t)return;this.CM.vars.requestCount++;const e=this.tRt(s,i);t.send(this.CM.extraUrlParams,i,e)}IRt(t,i){const s=t.parentPostMessage,e=this.tRt(i,t);(function(t,i,s,e,n,r){const o=Wi(t),h=lt(r),u=o.getMacros(r);n.freezeVar("extraUrlParams");const c=o.expandTemplate(i,n,r).then((t=>h.expandStringAsync(t,u)));return i.indexOf("${extraUrlParams}")<0?c:c.then((t=>{const i=St(St({},s),e.extraUrlParams);return Ie(o,h,i,n,u,r).then((i=>Ee(t,[{"extraUrlParams":i}])))}))})(this.getAmpDoc(),s,this.CM.extraUrlParams,t,e,this.element).then((t=>{this.win.parent.postMessage(t,"*")}))}iRt(t){const i=t.sampleSpec,s=this.ts();if(!i)return Promise.resolve(!0);const n=i.sampleOn;if(!n)return this.user().error(s,"Invalid sampleOn value."),Promise.resolve(!0);const r=parseFloat(i.threshold);if(r>=0&&r<=100){const i=new e,s=()=>{const s=this.tRt({},t),e=this.hRt(n,s).then((t=>this.IIt.uniform(t))).then((t=>100*t<r));i.resolve(e)};return this.RIt?s():es(this.element,s,10),i.promise}return H().error(s,"Invalid threshold for sampling."),Promise.resolve(!0)}ERt(t,i){const s=this.tRt(i,t),e=this.vRt(this.CM.enabled,s),n=this.vRt(t.enabled,s);return Promise.all([e,n]).then((t=>(q(2===t.length),t[0]&&t[1])))}vRt(t,i){return void 0===t?Promise.resolve(!0):"boolean"==typeof t?Promise.resolve(t):this.hRt(t,i).then((t=>Ki(t)))}hRt(t,i){return this.yT.expandTemplate(t,i,this.element).then((t=>lt(this.element).expandUrlAsync(t,this.yT.getMacros(this.element))))}ts(){return"AmpAnalytics "+(this.element.getAttribute("id")||"<unknown id>")}tRt(t,i,s,e){const n={};return Ji(this.CM.vars,n),Ji(i.vars,n),Ji(t.vars,n),new Ui(n,s,e)}};t.registerServiceForDoc("amp-analytics-instrumentation",class{constructor(t){this.ampdoc=t,this.pu=this.RRt(t.getRootNode())}dispose(){this.pu.dispose()}getAnalyticsRoot(t){return this.RRt(t)}createAnalyticsGroup(t){const i=this.RRt(t);return new class{constructor(t,i){this.pu=t,this.MRt=i,this.el=[],this.bRt=0,this.i=p(i)}dispose(){this.el.forEach((t=>{t()}))}addTrigger(t,i){const s=t.on,n=Vs(s),r=Ns(this.pu.getType()),o=this.pu.getTrackerForAllowlist(n,r);let h;$(!!o,'Trigger type "%s" is not allowed in the %s',s,this.pu.getType());const u=new e,c=()=>{h=o.add(this.MRt,s,t,i),this.el.push(h),u.resolve()};if(this.bRt<1||"inabox"==C(this.i).runtime)c();else{const t=this.bRt<3?20:10;es(this.MRt,c,t)}return this.bRt++,u.promise}}(i,t)}SRt(t){return t===Rs?xs:Ds}triggerEventForTarget(t,i,s={},e=!0){const n=new Cs(t,i,s,e),r=this.RRt(t),o=Vs(i);r.getTracker(o,this.SRt(o)).trigger(n)}RRt(t){const i=ot(t),s=X(t),e=s&&li(s);return i==this.ampdoc&&!e&&this.pu?this.pu:this.yRt(e||i,(()=>e?new le(i,e):new ae(i)))}yRt(t,i){let s=t[de];return s||(s=i(),t[de]=s),s}}),t.registerServiceForDoc("activity",class{constructor(t){this.ampdoc=t,this.wRt=this.ORt.bind(this),this.VRt=this.NRt.bind(this),this.CRt=this.kRt.bind(this),this.LRt=this.DRt.bind(this),this.xRt={},this.URt=[],this.HRt=!1,this.jRt=!1,this.FRt=new class{constructor(){this.qRt=0,this.$Rt=void 0}push(t){this.$Rt&&this.$Rt.time<t.time&&(this.qRt+=It(this.$Rt,t.time)),this.$Rt=t}getTotalEngagedTime(t){let i=0;return void 0!==this.$Rt&&(i=this.qRt+It(this.$Rt,t)),i}},this.Uu=_t(this.ampdoc),this.ampdoc.whenFirstVisible().then(this.On.bind(this))}On(){this.zn=Date.now(),this.NRt(),this.BRt()}GRt(){const t=Date.now()-this.zn;return t>0?t:0}ORt(){this.HRt=!1,this.jRt=!1}BRt(){this.WRt(this.ampdoc.getRootNode(),vt,this.VRt),this.WRt(this.ampdoc.getRootNode(),Rt,this.CRt),this.URt.push(this.ampdoc.onVisibilityChanged(this.LRt)),this.Uu.onScroll(this.VRt)}WRt(t,i,s){for(let e=0;e<i.length;e++)this.URt.push(Pt(t,i[e],s))}NRt(){this.HRt||(this.HRt=!0,this.jRt=!1,this.zRt(gt))}kRt(){this.jRt||(this.jRt=!0,this.HRt=!1,this.zRt("inactive"))}zRt(t){const i=this.GRt(),s=Math.floor(i/1e3),e=1e3-i%1e3;setTimeout(this.wRt,e),this.FRt.push({type:t,time:s})}DRt(){this.ampdoc.isVisible()?this.NRt():this.kRt()}Wg(){for(let t=0;t<this.URt.length;t++){const i=this.URt[t];"function"==typeof i&&i()}this.URt=[]}Mn(){this.Wg()}getTotalEngagedTime(){const t=Math.floor(this.GRt()/1e3);return this.FRt.getTotalEngagedTime(t)}getIncrementalEngagedTime(t,i=!0){if(!f(this.xRt,t))return i&&(this.xRt[t]=this.getTotalEngagedTime()),this.getTotalEngagedTime();const s=this.xRt[t];return!1===i?this.getTotalEngagedTime()-s:(this.xRt[t]=this.getTotalEngagedTime(),this.xRt[t]-s)}}),tt(ye=K(ye=t.win),ye,"amp-analytics-linker-reader",class{constructor(t){this.i=t,this.Ynt={}}get(t,i){return t&&i?(f(this.Ynt,t)||(this.Ynt[t]=this.YRt(t)),this.Ynt[t]&&this.Ynt[t][i]?this.Ynt[t][i]:null):(H().error("amp-analytics/linker-reader","LINKER_PARAM requires two params, name and id"),null)}YRt(t){const i=O(this.i.location.search);if(!f(i,t))return null;const s=i[t];return this.KRt(this.i.location,t),function(t){const i=function(t){const i=t.split(Ai),s=i.length%2==0;if(i.length<4||!s)return H().error(pi,`Invalid linker_param value ${t}`),null;const e=Number(i.shift());return 1!==e?(H().error(pi,`Invalid version number ${e}`),null):{checksum:i.shift(),serializedIds:i.join(Ai)}}(t);if(!i)return null;const{checksum:s,serializedIds:e}=i;return function(t,i){for(let s=0;s<=1;s++)if(Ei(t,s)==i)return!0;return!1}(e,s)?function(t){const i={},s=t.split(Ai);for(let t=0;t<s.length;t+=2){const e=s[t];if(!Pi.test(e)){H().error(pi,`Invalid linker key ${e}, value ignored`);continue}const n=gi(s[t+1]);i[e]=n}return i}(e):(H().error(pi,"LINKER_PARAM value checksum not valid"),null)}(s)}KRt(t,i){if(!this.i.history.replaceState)return;const s=Wt(t.search,i),e=t.origin+t.pathname+s+(t.hash||"");this.i.history.replaceState(null,"",e)}}),t.registerServiceForDoc("amp-analytics-session",class{constructor(t){this.eit=z(t,"storage"),this.XRt=l(),this.Ni=t,this.i=t.win,this.E_=[],this.JRt=null,this.rs=null,this.ZRt=!0,this.Au()}Au(){this.QRt(),this.E_.push(Pt(this.i,"focus",(()=>{this.JRt=!0,this.tMt()})),Pt(this.i,"blur",(()=>{this.JRt=!1,this.tMt()})),Pt(this.i,"pageshow",(()=>{this.ZRt=!0,this.tMt()})),Pt(this.i,"pagehide",(()=>{this.ZRt=!1,this.tMt()})),this.Ni.onVisibilityChanged((()=>{this.rs=this.Ni.isVisible(),this.tMt()})))}QRt(){this.JRt=this.i.document.hasFocus(),this.rs=!(function(t){const i=t[ei(t,"visibilityState",!0)];if(i)return i;const s=ei(t,"hidden",!0);return s in t&&t[s]?"hidden":Ii}(this.i.document)!=Ii)}tMt(){Object.keys(this.XRt).forEach((t=>{const i=this.XRt[t];i.engaged=this.iMt(),this.sMt(t,i)}))}dispose(){this.E_.forEach((t=>{t()})),this.E_.length=0}getSessionValue(t,i){return this.get(t).then((t=>null==t?void 0:t[i]))}updateEvent(t){return this.get(t,(t=>{t.eventTimestamp=Date.now()}))}get(t,i){return t?f(this.XRt,t)&&!Oi(this.XRt[t])?(this.XRt[t]=this.eMt(this.XRt[t]),null==i||i(this.XRt[t]),this.sMt(t,this.XRt[t]),Promise.resolve(this.XRt[t])):this.nMt(t,i):(H().error(vi,"Sessions can only be accessed with a vendor type."),Promise.resolve(null))}nMt(t,i){return this.eit.then((i=>{const s=Vi(t);return i.get(s)})).then((t=>{return t?this.eMt(a(i=t)?{[Ri]:i.sessionId,[Mi]:i.creationTimestamp,[wi]:i.count,[bi]:i.accessTimestamp,[yi]:i.eventTimestamp,[Si]:null===(s=i.engaged)||void 0===s||s}:(F().error(vi,"Invalid stored session value"),Ni()),!0):Ni(this.iMt());var i,s})).then((s=>(t in this.XRt&&!Oi(this.XRt[t])||(null==i||i(s),this.sMt(t,s),this.XRt[t]=s),this.XRt[t])))}eMt(t,i){const s=t.count,e=Date.now();if(Oi(t)){const i=(null!=s?s:0)+1;t=Ni(this.iMt(),i)}else{const s=i&&t.engaged;t.engaged=s||this.iMt(),s&&(this.JRt=!0,this.ZRt=!0,this.rs=!0)}return t.accessTimestamp=e,t}iMt(){return this.ZRt&&this.rs&&this.JRt}sMt(t,i){return this.eit.then((s=>{const e=Vi(t);s.setNonBoolean(e,i)}))}}),t.registerServiceForDoc("amp-analytics-variables",class{constructor(t){this.Ni=t,this.gN={},this.Qnt=B(this.Ni.win,"amp-analytics-linker-reader"),this.rMt=Ci(this.Ni),this.b$("$DEFAULT",ji),this.b$("$SUBSTR",Hi),this.b$("$TRIM",(t=>t.trim())),this.b$("$TOLOWERCASE",(t=>t.toLowerCase())),this.b$("$TOUPPERCASE",(t=>t.toUpperCase())),this.b$("$NOT",(t=>String(!t))),this.b$("$BASE64",(t=>Lt(t))),this.b$("$HASH",this.oMt.bind(this)),this.b$("$IF",((t,i,s)=>Ki(t)?i:s)),this.b$("$REPLACE",Fi),this.b$("$MATCH",qi),this.b$("$CALC",$i),this.b$("$EQUALS",((t,i)=>t===i)),this.b$("LINKER_PARAM",((t,i)=>this.Qnt.get(t,i))),this.b$("TIMEZONE_CODE",(()=>{let t="";return"Intl"in this.Ni.win&&"DateTimeFormat"in this.Ni.win.Intl&&(t=(new this.Ni.win.Intl.DateTimeFormat).resolvedOptions().timeZone),t})),this.b$("SCROLL_TOP",(()=>Math.round(_t(this.Ni).getScrollTop()))),this.b$("SCROLL_LEFT",(()=>Math.round(_t(this.Ni).getScrollLeft()))),this.b$("EXPERIMENT_BRANCHES",(t=>function(t,i){if(i)return function(t,i){return t.__AMP_EXPERIMENT_BRANCHES?t.__AMP_EXPERIMENT_BRANCHES[i]:null}(t,i)||"";const s=function(t){const i=K(t);return i.__AMP_EXPERIMENT_BRANCHES||(i.__AMP_EXPERIMENT_BRANCHES={}),St({},i.__AMP_EXPERIMENT_BRANCHES)}(t);return Object.keys(s).map((t=>`${t}:${s[t]}`)).join(",")}(this.Ni.win,t))),this.b$("AMPDOC_META",((t,i="")=>{var s;return null!==(s=this.Ni.getMetaByName(t))&&void 0!==s?s:i}))}getMacros(t){const i=t.getAttribute("type"),s={"COOKIE":i=>function(t,i,s){return di(t,i)?Jt(t,s):null}(this.Ni.win,t,i),"CONSENT_STATE":Yi(t),"CONSENT_STRING":ki(t),"CONSENT_METADATA":i=>function(t,i){return function(t,i="default"){return ft(t).then((t=>t?t.getConsentMetadataInfo(i):null))}(t).then((t=>t?t[i]:null))}(t,$(i,"CONSENT_METADATA macro must contain a key")),"SESSION_ID":()=>this.hMt(i,Ri),"SESSION_TIMESTAMP":()=>this.hMt(i,Mi),"SESSION_COUNT":()=>this.hMt(i,wi),"SESSION_EVENT_TIMESTAMP":()=>this.hMt(i,yi),"SESSION_ENGAGED":()=>this.hMt(i,Si)},e=fi(t)?{}:{"FIRST_CONTENTFUL_PAINT":()=>ut(this.Ni.win).getMetric("fcpv"),"FIRST_VIEWPORT_READY":()=>ut(this.Ni.win).getMetric("pc"),"MAKE_BODY_VISIBLE":()=>ut(this.Ni.win).getMetric("mbv"),"LARGEST_CONTENTFUL_PAINT":()=>ut(this.Ni.win).getMetric("lcpv"),"FIRST_INPUT_DELAY":()=>ut(this.Ni.win).getMetric("fid"),"CUMULATIVE_LAYOUT_SHIFT":()=>ut(this.Ni.win).getMetric("cls"),"INTERACTION_TO_NEXT_PAINT":()=>ut(this.Ni.win).getMetric("inp")};return St(St(St({},this.gN),s),e)}hMt(t,i){return this.rMt.then((s=>s.getSessionValue(t,i)))}b$(t,i){q(!this.gN[t]),this.gN[t]=i}expandTemplate(t,i,s,e,r){return function(t,i,s){const e=[];let n=0;return t.replace(i,(function(i){const r=arguments[arguments.length-2];e.push(t.slice(n,r)),n=r+i.length;const o=s.apply(null,arguments);return e.push(o),""})),e.push(t.slice(n)),Promise.all(e).then((t=>t.join("")))}(t,/\${([^{}]*)}/g,((t,o)=>{if(i.iterations<0)return H().error(Li,"Maximum depth reached while expanding variables. Please ensure that the variables are not recursive."),t;if(!o)return"";const{argList:h,name:u}=Gi(o);if(i.freezeVars[u])return t;let c=i.getVar(u);const a=lt(s);if("string"==typeof c)c=this.uMt(c,i,s,a,e,r,h);else if(n(c)){for(let t=0;t<c.length;t++)c[t]="string"==typeof c[t]?this.uMt(c[t],i,s,a,e,r):c[t];c=Promise.all(c)}return Promise.resolve(c).then((t=>i.noEncode?t:Bi(t)))}))}uMt(t,i,s,e,n,r,o){return this.expandTemplate(t,new Ui(i.vars,i.iterations-1,!0),s,n,r).then((t=>e.expandStringAsync(o?t+o:t,n||this.getMacros(s),r)))}oMt(t){return ht(this.Ni.win).sha384Base64(t)}}),t.registerElement(Oe,Ne)})();
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */}});
//# sourceMappingURL=amp-analytics-0.1.mjs.map